19 protected $mRevisionRecord =
null;
45 $services = MediaWikiServices::getInstance();
47 Hooks::runner()->onSearchResultInitFromTitle(
$title, $id );
49 $this->mRevisionRecord = $services->getRevisionLookup()->getRevisionByTitle(
52 RevisionLookup::READ_NORMAL
55 $this->mImage = $services->getRepoGroup()->findFile(
$title );
66 return $this->mTitle ===
null;
97 if ( !isset( $this->mText ) ) {
98 if ( $this->mRevisionRecord !=
null ) {
99 $content = $this->mRevisionRecord->getContent( SlotRecord::MAIN );
162 if ( $this->mRevisionRecord ) {
164 } elseif ( $this->mImage ) {
165 return $this->mImage->getTimestamp();
175 return str_word_count( $this->mText );
183 return strlen( $this->mText );
isMissingRevision()
Check if target page is missing, happens when index is out of date.
getInterwikiNamespaceText()
getTextSnippet( $terms=[])
initFromTitle( $title)
Initialize from a Title and if possible initializes a corresponding RevisionRecord and File.
isFileMatch()
Did this match file contents (eg: PDF/DJVU)?
isBrokenTitle()
Check if this is result points to an invalid title.
trait RevisionSearchResultTrait
Transitional trait used to share the methods between SearchResult and RevisionSearchResult.
getFile()
Get the file for this page, if one exists.
initText()
Lazy initialization of article text from DB.
Implements some public methods and some protected utility functions which are required by multiple ch...
getTimestamp()
Get the 14-character timestamp of the file upload.
Represents a title within MediaWiki.