16 protected $mRevision =
null;
41 $services = MediaWikiServices::getInstance();
42 if ( !is_null( $this->mTitle ) ) {
44 Hooks::run(
'SearchResultInitFromTitle', [
$title, &$id ] );
46 $this->mTitle, $id, Revision::READ_NORMAL );
47 if ( $this->mTitle->getNamespace() ===
NS_FILE ) {
48 $this->mImage = $services->getRepoGroup()->findFile( $this->mTitle );
59 return is_null( $this->mTitle );
90 if ( !isset( $this->mText ) ) {
91 if ( $this->mRevision !=
null ) {
92 $content = $this->mRevision->getContent();
155 if ( $this->mRevision ) {
157 } elseif ( $this->mImage ) {
158 return $this->mImage->getTimestamp();
168 return str_word_count( $this->mText );
176 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 Revision 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.
static newFromTitle(LinkTarget $linkTarget, $id=0, $flags=0)
Load either the current, or a specified, revision that's attached to a given link target.
Represents a title within MediaWiki.