MediaWiki
master
|
Public Member Functions | |
__construct ($modelId=null) | |
addSectionHeader ($header) | |
convert ($toModel, $lossy= '') | |
equals (Content $that=null) | |
getContentHandler () | |
getDefaultFormat () | |
getDeletionUpdates (WikiPage $page, ParserOutput $parserOutput=null) | |
getModel () | |
getRedirectChain () | |
getRedirectTarget () | |
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. | |
getSection ($sectionId) | |
getSupportedFormats () | |
getUltimateRedirectTarget () | |
isEmpty () | |
isRedirect () | |
isSupportedFormat ($format) | |
isValid () | |
matchMagicWord (MagicWord $word) | |
This default implementation always returns false. | |
preloadTransform (Title $title, ParserOptions $popts) | |
prepareSave (WikiPage $page, $flags, $baseRevId, User $user) | |
preSaveTransform (Title $title, User $user, ParserOptions $popts) | |
replaceSection ($section, Content $with, $sectionTitle= '') | |
serialize ($format=null) | |
updateRedirect (Title $target) | |
Protected Member Functions | |
checkFormat ($format) | |
Throws an MWException if $this->isSupportedFormat( $format ) does not return true. | |
checkModelID ($modelId) | |
Throws an MWException if $model_id is not the id of the content model supported by this Content object. | |
Protected Attributes | |
string | $model_id |
Name of the content model this Content object represents. |
Definition at line 28 of file AbstractContent.php.
AbstractContent::__construct | ( | $ | modelId = null | ) |
string | null | $modelId |
Reimplemented in RevisionTestModifyableContent, DummyContentForTesting, JavaScriptContent, WikitextContent, and CssContent.
Definition at line 44 of file AbstractContent.php.
AbstractContent::addSectionHeader | ( | $ | header | ) |
Implements Content.
Reimplemented in WikitextContent.
Definition at line 352 of file AbstractContent.php.
AbstractContent::checkFormat | ( | $ | format | ) | [protected] |
Throws an MWException if $this->isSupportedFormat( $format ) does not return true.
string | $format |
MWException |
Definition at line 130 of file AbstractContent.php.
AbstractContent::checkModelID | ( | $ | modelId | ) | [protected] |
Throws an MWException if $model_id is not the id of the content model supported by this Content object.
string | $modelId | The model to check |
MWException |
Definition at line 67 of file AbstractContent.php.
Referenced by TextContent\diff().
AbstractContent::convert | ( | $ | toModel, |
$ | lossy = '' |
||
) |
This base implementation calls the hook ConvertContent to enable custom conversions. Subclasses may override this to implement conversion for "their" content model.
String | $toModel | the desired content model, use the CONTENT_MODEL_XXX flags. |
String | $lossy | flag, set to "lossy" to allow lossy conversion. If lossy conversion is not allowed, full round-trip conversion is expected to work without losing information. |
Implements Content.
Reimplemented in TextContent.
Definition at line 427 of file AbstractContent.php.
AbstractContent::equals | ( | Content $ | that = null | ) |
Content | null | $that |
Implements Content.
Definition at line 183 of file AbstractContent.php.
Implements Content.
Definition at line 82 of file AbstractContent.php.
Referenced by TextContent\getParserOutput(), and WikitextContent\getParserOutput().
Implements Content.
Definition at line 91 of file AbstractContent.php.
AbstractContent::getDeletionUpdates | ( | WikiPage $ | page, |
ParserOutput $ | parserOutput = null |
||
) |
$page | WikiPage the deleted page |
$parserOutput | null|ParserOutput optional parser output object for efficient access to meta-information about the content object. Provide if you have one handy. |
Implements Content.
Definition at line 391 of file AbstractContent.php.
Implements Content.
Definition at line 53 of file AbstractContent.php.
Referenced by TextContent\getParserOutput(), and WikitextContent\replaceSection().
Implements Content.
Definition at line 245 of file AbstractContent.php.
Implements Content.
Reimplemented in WikitextContent.
Definition at line 279 of file AbstractContent.php.
AbstractContent::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.
This default implementation calls $this->getParserOutput( $content, $title, null, null, false ), and then calls getSecondaryDataUpdates( $title, $recursive ) on the resulting ParserOutput object.
Subclasses may override this to determine the secondary data updates more efficiently, preferrably without the need to generate a parser output object.
$title | Title The context for determining the necessary updates |
$old | Content|null An optional Content object representing the previous content, i.e. the content being replaced by this Content object. |
$recursive | boolean Whether to include recursive updates (default: false). |
$parserOutput | ParserOutput|null Optional ParserOutput object. Provide if you have one handy, to avoid re-parsing of the content. |
Implements Content.
Definition at line 228 of file AbstractContent.php.
AbstractContent::getSection | ( | $ | sectionId | ) |
Implements Content.
Reimplemented in WikitextContent.
Definition at line 325 of file AbstractContent.php.
Implements Content.
Definition at line 100 of file AbstractContent.php.
Implements Content.
Definition at line 289 of file AbstractContent.php.
Implements Content.
Definition at line 159 of file AbstractContent.php.
Implements Content.
Definition at line 301 of file AbstractContent.php.
Referenced by TextContent\isCountable(), WikitextContent\isCountable(), and WikitextContent\updateRedirect().
AbstractContent::isSupportedFormat | ( | $ | format | ) |
string | $format |
Implements Content.
Definition at line 113 of file AbstractContent.php.
Implements Content.
Definition at line 170 of file AbstractContent.php.
AbstractContent::matchMagicWord | ( | MagicWord $ | word | ) |
This default implementation always returns false.
Subclasses may override this to supply matching logic.
MagicWord | $word |
Implements Content.
Reimplemented in WikitextContent.
Definition at line 410 of file AbstractContent.php.
AbstractContent::preloadTransform | ( | Title $ | title, |
ParserOptions $ | popts | ||
) |
Implements Content.
Reimplemented in WikitextContent.
Definition at line 361 of file AbstractContent.php.
AbstractContent::prepareSave | ( | WikiPage $ | page, |
$ | flags, | ||
$ | baseRevId, | ||
User $ | user | ||
) |
Implements Content.
Definition at line 370 of file AbstractContent.php.
AbstractContent::preSaveTransform | ( | Title $ | title, |
User $ | user, | ||
ParserOptions $ | popts | ||
) |
Implements Content.
Reimplemented in TextContent, WikitextContent, JavaScriptContent, and CssContent.
Definition at line 343 of file AbstractContent.php.
AbstractContent::replaceSection | ( | $ | section, |
Content $ | with, | ||
$ | sectionTitle = '' |
||
) |
Implements Content.
Reimplemented in WikitextContent.
Definition at line 334 of file AbstractContent.php.
AbstractContent::serialize | ( | $ | format = null | ) |
string | null | $format |
Implements Content.
Reimplemented in DummyContentForTesting.
Definition at line 148 of file AbstractContent.php.
AbstractContent::updateRedirect | ( | Title $ | target | ) |
This default implementation always returns $this.
Title | $target |
Implements Content.
Reimplemented in WikitextContent.
Definition at line 316 of file AbstractContent.php.
string AbstractContent::$model_id [protected] |
Name of the content model this Content object represents.
Use with CONTENT_MODEL_XXX constants
$model_id
Definition at line 37 of file AbstractContent.php.
Referenced by TextContent\__construct().