MediaWiki master
|
Content object implementation representing unknown content. More...
Inherits MediaWiki\Content\AbstractContent.
Public Member Functions | |
__construct ( $data, $model_id) | |
convert ( $toModel, $lossy='') | |
copy () | |
getData () | |
getNativeData () | |
getSize () | |
Returns the data size in bytes. | |
getTextForSearchIndex () | |
Returns an empty string. | |
getTextForSummary ( $maxlength=250) | |
Returns an empty string. | |
getWikitextForTransclusion () | |
isCountable ( $hasLinks=null) | |
Returns false. | |
serialize ( $format=null) | |
![]() | |
__construct ( $modelId=null) | |
addSectionHeader ( $header) | |
equals (?Content $that=null) | |
getContentHandler () | |
getDefaultFormat () | |
getModel () | |
getRedirectTarget () | |
Subclasses that implement redirects should override this. | |
getSection ( $sectionId) | |
getSupportedFormats () | |
isEmpty () | |
isRedirect () | |
isSupportedFormat ( $format) | |
isValid () | |
matchMagicWord (MagicWord $word) | |
This default implementation always returns false. | |
replaceSection ( $sectionId, Content $with, $sectionTitle='') | |
updateRedirect (Title $target) | |
This default implementation always returns $this. | |
Protected Member Functions | |
equalsInternal (Content $that) | |
Helper for AbstractContent::equals. | |
![]() | |
checkFormat ( $format) | |
Helper for subclasses. | |
checkModelID ( $modelId) | |
Helper for subclasses. | |
getContentHandlerFactory () | |
Additional Inherited Members | |
![]() | |
string | $model_id |
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.
FallbackContent instances are immutable.
Definition at line 35 of file FallbackContent.php.
MediaWiki\Content\FallbackContent::__construct | ( | $data, | |
$model_id ) |
string | $data | |
string | $model_id | The model ID to handle |
Definition at line 44 of file FallbackContent.php.
References MediaWiki\Content\AbstractContent\$model_id.
MediaWiki\Content\FallbackContent::convert | ( | $toModel, | |
$lossy = '' ) |
string | $toModel | |
string | $lossy |
Reimplemented from MediaWiki\Content\AbstractContent.
Definition at line 134 of file FallbackContent.php.
MediaWiki\Content\FallbackContent::copy | ( | ) |
Implements MediaWiki\Content\Content.
Definition at line 53 of file FallbackContent.php.
|
protected |
Helper for AbstractContent::equals.
This method can be overwritten by subclasses that only need to implement custom equality checks, with the rest of the Content::equals contract taken care of by AbstractContent::equals.
This default implementation compares Content::serialize of each object.
If you override this method, you can safely assume that $that is an instance of the same class as the current Content object. This is ensured by AbstractContent::equals.
Content | $that |
Reimplemented from MediaWiki\Content\AbstractContent.
Definition at line 138 of file FallbackContent.php.
References MediaWiki\Content\FallbackContent\getData().
MediaWiki\Content\FallbackContent::getData | ( | ) |
Definition at line 100 of file FallbackContent.php.
Referenced by MediaWiki\Content\FallbackContent\equalsInternal(), MediaWiki\Content\FallbackContent\getNativeData(), and MediaWiki\Content\FallbackContent\serialize().
MediaWiki\Content\FallbackContent::getNativeData | ( | ) |
Reimplemented from MediaWiki\Content\AbstractContent.
Definition at line 93 of file FallbackContent.php.
References MediaWiki\Content\FallbackContent\getData().
MediaWiki\Content\FallbackContent::getSize | ( | ) |
Returns the data size in bytes.
Implements MediaWiki\Content\Content.
Definition at line 74 of file FallbackContent.php.
MediaWiki\Content\FallbackContent::getTextForSearchIndex | ( | ) |
Returns an empty string.
Implements MediaWiki\Content\Content.
Definition at line 118 of file FallbackContent.php.
MediaWiki\Content\FallbackContent::getTextForSummary | ( | $maxlength = 250 | ) |
Returns an empty string.
int | $maxlength |
Implements MediaWiki\Content\Content.
Definition at line 65 of file FallbackContent.php.
MediaWiki\Content\FallbackContent::getWikitextForTransclusion | ( | ) |
Implements MediaWiki\Content\Content.
Definition at line 125 of file FallbackContent.php.
MediaWiki\Content\FallbackContent::isCountable | ( | $hasLinks = null | ) |
Returns false.
bool | null | $hasLinks | If it is known whether this content contains links, provide this information here, to avoid redundant parsing to find out. |
Implements MediaWiki\Content\Content.
Definition at line 86 of file FallbackContent.php.
MediaWiki\Content\FallbackContent::serialize | ( | $format = null | ) |
string | null | $format |
Reimplemented from MediaWiki\Content\AbstractContent.
Definition at line 109 of file FallbackContent.php.
References MediaWiki\Content\FallbackContent\getData().