MediaWiki 1.42.0
Content.php
Go to the documentation of this file.
1<?php
23
37interface Content {
38
49 public function getTextForSearchIndex();
50
63 public function getWikitextForTransclusion();
64
76 public function getTextForSummary( $maxLength = 250 );
77
93 public function getNativeData();
94
100 public function getSize();
101
110 public function getModel();
111
122 public function getContentHandler();
123
134 public function getDefaultFormat();
135
146 public function getSupportedFormats();
147
163 public function isSupportedFormat( $format );
164
176 public function serialize( $format = null );
177
185 public function isEmpty();
186
199 public function isValid();
200
226 public function equals( Content $that = null );
227
246 public function copy();
247
263 public function isCountable( $hasLinks = null );
264
273 public function getRedirectTarget();
274
285 public function isRedirect();
286
298 public function updateRedirect( Title $target );
299
312 public function getSection( $sectionId );
313
328 public function replaceSection( $sectionId, Content $with, $sectionTitle = '' );
329
341 public function addSectionHeader( $header );
342
352 public function matchMagicWord( MagicWord $word );
353
366 public function convert( $toModel, $lossy = '' );
367
368 // @todo ImagePage and CategoryPage interfere with per-content action handlers
369 // @todo nice integration of GeSHi syntax highlighting
370 // [11:59] <vvv> Hooks are ugly; make CodeHighlighter interface and a
371 // config to set the class which handles syntax highlighting
372 // [12:00] <vvv> And default it to a DummyHighlighter
373
374}
This class encapsulates "magic words" such as "#redirect", NOTOC, etc.
Definition MagicWord.php:65
Represents a title within MediaWiki.
Definition Title.php:78
Base interface for representing page content.
Definition Content.php:37
getRedirectTarget()
Construct the redirect destination from this content and return a Title, or null if this content does...
isCountable( $hasLinks=null)
Returns true if this content is countable as a "real" wiki page, provided that it's also in a countab...
convert( $toModel, $lossy='')
Converts this content object into another content object with the given content model,...
getContentHandler()
Convenience method that returns the ContentHandler singleton for handling the content model that this...
getTextForSummary( $maxLength=250)
Returns a textual representation of the content suitable for use in edit summaries and log messages.
getSection( $sectionId)
Returns the section with the given ID.
getNativeData()
Returns native representation of the data.
getModel()
Returns the ID of the content model used by this Content object.
copy()
Return a copy of this Content object.
getTextForSearchIndex()
getSize()
Returns the content's nominal size in "bogo-bytes".
serialize( $format=null)
Convenience method for serializing this Content object.
getDefaultFormat()
Convenience method that returns the default serialization format for the content model that this Cont...
getSupportedFormats()
Convenience method that returns the list of serialization formats supported for the content model tha...
isSupportedFormat( $format)
Returns true if $format is a supported serialization format for this Content object,...
matchMagicWord(MagicWord $word)
Returns true if this Content object matches the given magic word.
addSectionHeader( $header)
Returns a new WikitextContent object with the given section heading prepended, if supported.
isRedirect()
Returns whether this Content represents a redirect.
isEmpty()
Returns true if this Content object represents empty content.
replaceSection( $sectionId, Content $with, $sectionTitle='')
Replaces a section of the content and returns a Content object with the section replaced.
equals(Content $that=null)
Returns true if this Content objects is conceptually equivalent to the given Content object.
getWikitextForTransclusion()
isValid()
Returns whether the content is valid.
updateRedirect(Title $target)
If this Content object is a redirect, this method updates the redirect target.
$header