MediaWiki  master
FallbackContent Class Reference

Content object implementation representing unknown content. More...

Inheritance diagram for FallbackContent:
Collaboration diagram for FallbackContent:

Public Member Functions

 __construct ( $data, $model_id)
 
 convert ( $toModel, $lossy='')
 
 copy ()
 
 getData ()
 
 getNativeData ()
 
 getSize ()
 Returns the data size in bytes. More...
 
 getTextForSearchIndex ()
 Returns an empty string. More...
 
 getTextForSummary ( $maxlength=250)
 Returns an empty string. More...
 
 getWikitextForTransclusion ()
 
 isCountable ( $hasLinks=null)
 Returns false. More...
 
 serialize ( $format=null)
 
- Public Member Functions inherited from AbstractContent
 __construct ( $modelId=null)
 Stable to call. More...
 
 addSectionHeader ( $header)
 Stable to override. More...
 
 equals (Content $that=null)
 Decides whether two Content objects are equal. More...
 
 getContentHandler ()
 
 getDefaultFormat ()
 
 getDeletionUpdates (WikiPage $page, ParserOutput $parserOutput=null)
 Stable to override. More...
 
 getModel ()
 
 getParserOutput (Title $title, $revId=null, ParserOptions $options=null, $generateHtml=true)
 Returns a ParserOutput object containing information derived from this content. More...
 
 getRedirectChain ()
 
 getRedirectTarget ()
 Subclasses that implement redirects should override this. More...
 
 getSecondaryDataUpdates (Title $title, Content $old=null, $recursive=true, ParserOutput $parserOutput=null)
 Returns a list of DataUpdate objects for recording information about this Content in some secondary data store. More...
 
 getSection ( $sectionId)
 Stable to override. More...
 
 getSupportedFormats ()
 
 getUltimateRedirectTarget ()
 
 isEmpty ()
 Stable to override. More...
 
 isRedirect ()
 
 isSupportedFormat ( $format)
 
 isValid ()
 Subclasses may override this to implement (light weight) validation. More...
 
 matchMagicWord (MagicWord $word)
 This default implementation always returns false. More...
 
 preloadTransform (Title $title, ParserOptions $popts, $params=[])
 Stable to override. More...
 
 prepareSave (WikiPage $page, $flags, $parentRevId, User $user)
 Stable to override. More...
 
 preSaveTransform (Title $title, User $user, ParserOptions $popts)
 Stable to override. More...
 
 replaceSection ( $sectionId, Content $with, $sectionTitle='')
 Stable to override. More...
 
 updateRedirect (Title $target)
 This default implementation always returns $this. More...
 

Protected Member Functions

 equalsInternal (Content $that)
 Checks whether $that is logically equal to this Content object. More...
 
 fillParserOutput (Title $title, $revId, ParserOptions $options, $generateHtml, ParserOutput &$output)
 Fills the ParserOutput with an error message. More...
 
- Protected Member Functions inherited from AbstractContent
 checkFormat ( $format)
 
 checkModelID ( $modelId)
 
 getContentHandlerFactory ()
 

Private Attributes

string $data
 

Additional Inherited Members

- Protected Attributes inherited from AbstractContent
string $model_id
 Name of the content model this Content object represents. More...
 

Detailed Description

Content object implementation representing unknown content.

This can be used to handle content for which no ContentHandler exists on the system, perhaps because the extension that provided it has been removed.

UnknownContent instances are immutable.

Definition at line 38 of file FallbackContent.php.

Constructor & Destructor Documentation

◆ __construct()

FallbackContent::__construct (   $data,
  $model_id 
)
Parameters
string$data
string$model_idThe model ID to handle

Definition at line 47 of file FallbackContent.php.

References $data, and AbstractContent\$model_id.

Member Function Documentation

◆ convert()

FallbackContent::convert (   $toModel,
  $lossy = '' 
)
Parameters
string$toModel
string$lossy
Returns
false

Reimplemented from AbstractContent.

Definition at line 153 of file FallbackContent.php.

◆ copy()

FallbackContent::copy ( )
Returns
Content $this

Implements Content.

Definition at line 56 of file FallbackContent.php.

◆ equalsInternal()

FallbackContent::equalsInternal ( Content  $that)
protected

Checks whether $that is logically equal to this Content object.

This method can be overwritten by subclasses that need to implement custom equality checks.

This default implementation checks whether the serializations of $this and $that are the same: $this->serialize() === $that->serialize()

Implementors can assume that $that is an instance of the same class as the present Content object, as long as equalsInternal() is only called by the standard implementation of equals().

Note
Do not call this method directly, call equals() instead.

Stable to override

Parameters
Content$that
Returns
bool

Reimplemented from AbstractContent.

Definition at line 157 of file FallbackContent.php.

References getData().

◆ fillParserOutput()

FallbackContent::fillParserOutput ( Title  $title,
  $revId,
ParserOptions  $options,
  $generateHtml,
ParserOutput $output 
)
protected

Fills the ParserOutput with an error message.

Parameters
Title$title
int$revId
ParserOptions$options
bool$generateHtml
ParserOutput&$output

Reimplemented from AbstractContent.

Definition at line 140 of file FallbackContent.php.

References AbstractContent\getModel(), Html\rawElement(), ParserOutput\setText(), and wfMessage().

◆ getData()

FallbackContent::getData ( )
Returns
string data of unknown format and meaning

Definition at line 103 of file FallbackContent.php.

References $data.

Referenced by equalsInternal(), getNativeData(), and serialize().

◆ getNativeData()

FallbackContent::getNativeData ( )
Returns
string data of unknown format and meaning

Implements Content.

Definition at line 96 of file FallbackContent.php.

References getData().

◆ getSize()

FallbackContent::getSize ( )

Returns the data size in bytes.

Returns
int

Implements Content.

Definition at line 77 of file FallbackContent.php.

◆ getTextForSearchIndex()

FallbackContent::getTextForSearchIndex ( )

Returns an empty string.

Returns
string The raw text.

Implements Content.

Definition at line 121 of file FallbackContent.php.

◆ getTextForSummary()

FallbackContent::getTextForSummary (   $maxlength = 250)

Returns an empty string.

Parameters
int$maxlength
Returns
string

Implements Content.

Definition at line 68 of file FallbackContent.php.

◆ getWikitextForTransclusion()

FallbackContent::getWikitextForTransclusion ( )
Returns
false

Implements Content.

Definition at line 128 of file FallbackContent.php.

◆ isCountable()

FallbackContent::isCountable (   $hasLinks = null)

Returns false.

Parameters
bool | null$hasLinksIf it is known whether this content contains links, provide this information here, to avoid redundant parsing to find out.
Returns
bool

Implements Content.

Definition at line 89 of file FallbackContent.php.

◆ serialize()

FallbackContent::serialize (   $format = null)
Parameters
string | null$format
Returns
string data of unknown format and meaning

Reimplemented from AbstractContent.

Definition at line 112 of file FallbackContent.php.

References getData().

Member Data Documentation

◆ $data

string FallbackContent::$data
private

Definition at line 41 of file FallbackContent.php.

Referenced by __construct(), and getData().


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