MediaWiki
master
|
Base content handler implementation for flat text contents. More...
Public Member Functions | |
__construct ($modelId=CONTENT_MODEL_TEXT, $formats=[CONTENT_FORMAT_TEXT]) | |
getFieldsForSearchIndex (SearchEngine $engine) | |
makeEmptyContent () | |
Creates an empty TextContent object. More... | |
merge3 (Content $oldContent, Content $myContent, Content $yourContent) | |
Attempts to merge differences between three versions. More... | |
serializeContent (Content $content, $format=null) | |
Returns the content's text as-is. More... | |
supportsDirectEditing () | |
unserializeContent ($text, $format=null) | |
Unserializes a Content object of the type supported by this ContentHandler. More... | |
Protected Member Functions | |
getContentClass () | |
Returns the name of the associated Content class, to be used when creating new objects. More... | |
Base content handler implementation for flat text contents.
Definition at line 31 of file TextContentHandler.php.
TextContentHandler::__construct | ( | $modelId = CONTENT_MODEL_TEXT , |
|
$formats = [ CONTENT_FORMAT_TEXT ] |
|||
) |
Definition at line 34 of file TextContentHandler.php.
|
protected |
Returns the name of the associated Content class, to be used when creating new objects.
Override expected by subclasses.
Definition at line 103 of file TextContentHandler.php.
Referenced by makeEmptyContent(), and unserializeContent().
TextContentHandler::getFieldsForSearchIndex | ( | SearchEngine | $engine | ) |
Definition at line 145 of file TextContentHandler.php.
References SearchIndexField\INDEX_TYPE_KEYWORD, and SearchEngine\makeSearchFieldMapping().
TextContentHandler::makeEmptyContent | ( | ) |
Creates an empty TextContent object.
Definition at line 131 of file TextContentHandler.php.
References getContentClass().
Referenced by merge3().
Attempts to merge differences between three versions.
Returns a new Content object for a clean merge and false for failure or a conflict.
All three Content objects passed as parameters must have the same content model.
This text-based implementation uses wfMerge().
Content | $oldContent | The page's previous content. |
Content | $myContent | One of the page's conflicting contents. |
Content | $yourContent | One of the page's conflicting contents. |
Definition at line 68 of file TextContentHandler.php.
References Content\getModel(), makeEmptyContent(), serializeContent(), unserializeContent(), and wfMerge().
TextContentHandler::serializeContent | ( | Content | $content, |
$format = null |
|||
) |
Returns the content's text as-is.
Content | $content | |
string | $format | The serialization format to check |
Definition at line 47 of file TextContentHandler.php.
References Content\getNativeData().
Referenced by merge3().
TextContentHandler::supportsDirectEditing | ( | ) |
Definition at line 141 of file TextContentHandler.php.
TextContentHandler::unserializeContent | ( | $text, | |
$format = null |
|||
) |
Unserializes a Content object of the type supported by this ContentHandler.
string | $text | Serialized form of the content |
string | $format | The format used for serialization |
Definition at line 117 of file TextContentHandler.php.
References getContentClass().
Referenced by merge3().