36 parent::__construct( $modelId, $formats );
80 $ok =
wfMerge( $old, $mine, $yours, $result );
92 return $mergedContent;
105 return TextContent::class;
122 return new $class( $text );
134 return new $class(
'' );
147 $fields = parent::getFieldsForSearchIndex( $engine );
148 $fields[
'language'] =
159 $fields = parent::getDataForSearchIndex( $page, $output, $engine );
160 $fields[
'language'] =
174 if ( $shouldCallDeprecatedMethod ) {
181 '@phan-var TextContent $content';
185 $pst = TextContent::normalizeLineEndings( $text );
188 return ( $text === $pst ) ?
$content :
new $contentClass( $pst,
$content->getModel() );
const CONTENT_FORMAT_TEXT
For future use, e.g.
wfMerge( $old, $mine, $yours, &$result, &$mergeAttemptResult=null)
wfMerge attempts to merge differences between three texts.
A content handler knows how do deal with a specific type of content on a wiki page.
checkFormat( $format)
Convenient for checking whether a format provided as a parameter is actually supported.
shouldCallDeprecatedContentTransformMethod(Content $content, $params)
Check if we need to provide content overrides deprecated Content method.
getPageLanguage(Title $title, Content $content=null)
Get the language in which the content of the given page is written.
getDefaultFormat()
The format used for serialization/deserialization by default by this ContentHandler.
callDeprecatedContentPST(Content $content, PreSaveTransformParams $params)
Provided content overrides deprecated Content::preSaveTransform, call it and return.
Contain a class for special pages.
makeSearchFieldMapping( $name, $type)
Create a search field definition.
Base content handler implementation for flat text contents.
unserializeContent( $text, $format=null)
Unserializes a Content object of the type supported by this ContentHandler.
getDataForSearchIndex(WikiPage $page, ParserOutput $output, SearchEngine $engine)
Return fields to be indexed by search engine as representation of this document.
serializeContent(Content $content, $format=null)
Returns the content's text as-is.
getContentClass()
Returns the name of the associated Content class, to be used when creating new objects.
__construct( $modelId=CONTENT_MODEL_TEXT, $formats=[CONTENT_FORMAT_TEXT])
Constructor, initializing the ContentHandler instance with its model ID and a list of supported forma...
getFieldsForSearchIndex(SearchEngine $engine)
Get fields definition for search index.
makeEmptyContent()
Creates an empty TextContent object.
merge3(Content $oldContent, Content $myContent, Content $yourContent)
Attempts to merge differences between three versions.
preSaveTransform(Content $content, PreSaveTransformParams $pstParams)
Returns a $content object with pre-save transformations applied (or the same object if no transformat...
Class representing a MediaWiki article and history.
getContent( $audience=RevisionRecord::FOR_PUBLIC, Authority $performer=null)
Get the content of the current revision.
getTitle()
Get the title object of the article.
Base interface for content objects.
getModel()
Returns the ID of the content model used by this Content object.