Manual:Content.php
Appearance
MediaWiki ファイル: Content.php | |
---|---|
場所: | includes/content/ |
ソース コード: | master • 1.42.3 • 1.41.4 • 1.39.10 |
クラス: | MediaWiki\Content\Content |
Content.php contains the Content interface, the base interface for content objects. A content object represents page content, e.g. the text to show on a page. Content objects have no knowledge about how they relate to wiki pages.
Instantiation
- ContentHandler::makeContent() - create a Content object from given textual representation. Text will be deserialized according to given content model.
Retrieval
- RevisionRecord::getContent() - get the Content object from a page revision.
Transformation
If you have access to a Content object but need to transform it before saving or on page preload.
- ContentTransformer::preSaveTransform() - return a Content object with pre-save transformations applied, or default content if no transformations apply.
- ContentTransformer::preloadTransform() - return a Content object with preload transformations applied, or again default content if no transformations apply. Before 1.37, this method was available in the Content class.
- ContentHandler::preloadTransform() - return a Content object with preload transformations applied, or again default content if no transformations apply.
メソッド
- getTextForSearchIndex()
- getWikitextForTransclusion()
- getTextForSummary()
- getSize()
- getModel()
- getContentHandler()
- getDefaultFormat()
- getSupportedFormats()
- isSupportedFormat()
- serialize()
- isEmpty()
- isValid()
- equals()
- copy()
- isCountable()
- getRedirectTarget()
- isRedirect()
- updateRedirect()
- getSection()
- replaceSection()
- addSectionHeader()
- matchMagicWord()
- convert()
Deprecated or removed
- getNativeData() - use getText() for TextContent instances. Use specialized getters for other content models.
- prepareSave() - use ContentHandler::validateSave .
- getParserOutput() - use ContentRenderer::getParserOutput
- Now part of ContentTransformer : preSaveTransform() (use ContentTransformer::preSaveTransform), preloadTransform() (use ContentTransformer::preloadTransform).
Implemented by
- Manual:AbstractContent.php - base implementation, which is extended by other classes such as TextContent , which is in turn extended by WikitextContent .