BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
SearchResult Class Reference

Public Member Functions

 isBrokenTitle ()
 
 isMissingRevision ()
 
 getTitle ()
 
 getFile ()
 
 getTextSnippet ($terms)
 
 getTitleSnippet ()
 
 getRedirectSnippet ()
 
 getRedirectTitle ()
 
 getSectionSnippet ()
 
 getSectionTitle ()
 
 getCategorySnippet ()
 
 getTimestamp ()
 
 getWordCount ()
 
 getByteSize ()
 
 getInterwikiPrefix ()
 
 getInterwikiNamespaceText ()
 
 isFileMatch ()
 

Static Public Member Functions

static newFromTitle ($title)
 

Protected Member Functions

 initFromTitle ($title)
 
 initText ()
 

Protected Attributes

 $mRevision = null
 
 $mImage = null
 
 $mTitle
 
 $mText
 
 $searchEngine
 

Detailed Description

Todo:
FIXME: This class is horribly factored. It would probably be better to have a useful base class to which you pass some standard information, then let the fancy self-highlighters extend that.

Member Function Documentation

SearchResult::getByteSize ( )
Returns
int Size in bytes
SearchResult::getCategorySnippet ( )
Returns
string Highlighted relevant category name or '' if none or not supported
SearchResult::getFile ( )

Get the file for this page, if one exists

Returns
File|null
SearchResult::getInterwikiNamespaceText ( )
Returns
string Interwiki namespace of the title (since we likely can't resolve it locally)
SearchResult::getInterwikiPrefix ( )
Returns
string Interwiki prefix of the title (return iw even if title is broken)
SearchResult::getRedirectSnippet ( )
Returns
string Highlighted redirect name (redirect to this page), '' if none or not supported
SearchResult::getRedirectTitle ( )
Returns
Title|null Title object for the redirect to this page, null if none or not supported
SearchResult::getSectionSnippet ( )
Returns
string Highlighted relevant section name, null if none or not supported
SearchResult::getSectionTitle ( )
Returns
Title|null Title object (pagename+fragment) for the section, null if none or not supported
SearchResult::getTextSnippet (   $terms)
Parameters
array$termsTerms to highlight
Returns
string Highlighted text snippet, null (and not '') if not supported
SearchResult::getTimestamp ( )
Returns
string Timestamp
SearchResult::getTitle ( )
Returns
Title
SearchResult::getTitleSnippet ( )
Returns
string Highlighted title, '' if not supported
SearchResult::getWordCount ( )
Returns
int Number of words
SearchResult::initFromTitle (   $title)
protected

Initialize from a Title and if possible initializes a corresponding Revision and File.

Parameters
Title$title
SearchResult::initText ( )
protected

Lazy initialization of article text from DB

SearchResult::isBrokenTitle ( )

Check if this is result points to an invalid title

Returns
bool
SearchResult::isFileMatch ( )

Did this match file contents (eg: PDF/DJVU)?

Returns
bool
SearchResult::isMissingRevision ( )

Check if target page is missing, happens when index is out of date

Returns
bool
static SearchResult::newFromTitle (   $title)
static

Return a new SearchResult and initializes it with a title.

Parameters
Title$title
Returns
SearchResult

The documentation for this class was generated from the following file: