MediaWiki  1.33.1
DummyNonTextContent Class Reference
Inheritance diagram for DummyNonTextContent:
Collaboration diagram for DummyNonTextContent:

Public Member Functions

 __construct ( $data)
 
 copy ()
 Return a copy of this Content object. More...
 
 getNativeData ()
 Returns native represenation of the data. More...
 
 getParserOutput (Title $title, $revId=null, ParserOptions $options=null, $generateHtml=true)
 
 getSize ()
 returns the content's nominal size in bogo-bytes. More...
 
 getTextForSearchIndex ()
 
 getTextForSummary ( $maxlength=250)
 Returns a textual representation of the content suitable for use in edit summaries and log messages. More...
 
 getWikitextForTransclusion ()
 
 isCountable ( $hasLinks=null)
 Returns true if this content is countable as a "real" wiki page, provided that it's also in a countable location (e.g. More...
 
 serialize ( $format=null)
 
- Public Member Functions inherited from AbstractContent
 addSectionHeader ( $header)
 
 convert ( $toModel, $lossy='')
 This base implementation calls the hook ConvertContent to enable custom conversions. More...
 
 equals (Content $that=null)
 Decides whether two Content objects are equal. More...
 
 getContentHandler ()
 
 getDefaultFormat ()
 
 getDeletionUpdates (WikiPage $page, ParserOutput $parserOutput=null)
 
 getModel ()
 
 getRedirectChain ()
 
 getRedirectTarget ()
 Subclasses that implement redirects should override this. More...
 
 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. More...
 
 getSection ( $sectionId)
 
 getSupportedFormats ()
 
 getUltimateRedirectTarget ()
 
 isEmpty ()
 
 isRedirect ()
 
 isSupportedFormat ( $format)
 
 isValid ()
 Subclasses may override this to implement (light weight) validation. More...
 
 matchMagicWord (MagicWord $word)
 This default implementation always returns false. More...
 
 preloadTransform (Title $title, ParserOptions $popts, $params=[])
 
 prepareSave (WikiPage $page, $flags, $parentRevId, User $user)
 
 preSaveTransform (Title $title, User $user, ParserOptions $popts)
 
 replaceSection ( $sectionId, Content $with, $sectionTitle='')
 
 updateRedirect (Title $target)
 This default implementation always returns $this. More...
 

Protected Member Functions

 fillParserOutput (Title $title, $revId, ParserOptions $options, $generateHtml, ParserOutput &$output)
 
- Protected Member Functions inherited from AbstractContent
 checkFormat ( $format)
 
 checkModelID ( $modelId)
 
 equalsInternal (Content $that)
 Checks whether $that is logically equal to this Content object. More...
 

Additional Inherited Members

- Protected Attributes inherited from AbstractContent
 $model_id
 Name of the content model this Content object represents. More...
 

Detailed Description

Definition at line 3 of file DummyNonTextContent.php.

Constructor & Destructor Documentation

◆ __construct()

DummyNonTextContent::__construct (   $modelId)
Parameters
string | null$modelId
Since
1.21

Reimplemented from AbstractContent.

Definition at line 5 of file DummyNonTextContent.php.

References $data, and data.

Member Function Documentation

◆ copy()

DummyNonTextContent::copy ( )

Return a copy of this Content object.

The following must be true for the object returned if $copy = $original->copy()

  • get_class($original) === get_class($copy)
  • $original->getModel() === $copy->getModel()
  • $original->equals( $copy )

If and only if the Content object is imutable, the copy() method can and should return $this. That is, $copy === $original may be true, but only for imutable content objects.

Returns
Content A copy of this object

Implements Content.

Definition at line 77 of file DummyNonTextContent.php.

◆ fillParserOutput()

DummyNonTextContent::fillParserOutput ( Title  $title,
  $revId,
ParserOptions  $options,
  $generateHtml,
ParserOutput $output 
)
protected
See also
AbstractContent::fillParserOutput()
Parameters
Title$titleContext title for parsing
int | null$revIdRevision ID (for {{REVISIONID}})
ParserOptions$options
bool$generateHtmlWhether or not to generate HTML
ParserOutput&$outputThe output object to fill (reference).

Reimplemented from AbstractContent.

Definition at line 117 of file DummyNonTextContent.php.

References $output, and serialize().

◆ getNativeData()

DummyNonTextContent::getNativeData ( )

Returns native represenation of the data.

Interpretation depends on the data model used, as given by getDataModel().

Returns
mixed The native representation of the content. Could be a string, a nested array structure, an object, a binary blob... anything, really.

Implements Content.

Definition at line 50 of file DummyNonTextContent.php.

References $data.

◆ getParserOutput()

DummyNonTextContent::getParserOutput ( Title  $title,
  $revId = null,
ParserOptions  $options = null,
  $generateHtml = true 
)
Parameters
Title$title
int | null$revIdUnused.
null | ParserOptions$options
bool$generateHtmlWhether to generate Html (default: true). If false, the result of calling getText() on the ParserOutput object returned by this method is undefined.
Returns
ParserOutput

Reimplemented from AbstractContent.

Definition at line 102 of file DummyNonTextContent.php.

References serialize().

◆ getSize()

DummyNonTextContent::getSize ( )

returns the content's nominal size in bogo-bytes.

Returns
int

Implements Content.

Definition at line 59 of file DummyNonTextContent.php.

References data.

◆ getTextForSearchIndex()

DummyNonTextContent::getTextForSearchIndex ( )
Returns
string A string representing the content in a way useful for building a full text search index. If no useful representation exists, this method returns an empty string.

Implements Content.

Definition at line 20 of file DummyNonTextContent.php.

◆ getTextForSummary()

DummyNonTextContent::getTextForSummary (   $maxlength = 250)

Returns a textual representation of the content suitable for use in edit summaries and log messages.

Parameters
int$maxlengthMaximum length of the summary text.
Returns
string The summary text.

Implements Content.

Definition at line 39 of file DummyNonTextContent.php.

◆ getWikitextForTransclusion()

DummyNonTextContent::getWikitextForTransclusion ( )
Returns
string|bool The wikitext to include when another page includes this content, or false if the content is not includable in a wikitext page.

Implements Content.

Definition at line 28 of file DummyNonTextContent.php.

◆ isCountable()

DummyNonTextContent::isCountable (   $hasLinks = null)

Returns true if this content is countable as a "real" wiki page, provided that it's also in a countable location (e.g.

a current revision in the main namespace).

Parameters
bool | null$hasLinksIf it is known whether this content contains links, provide this information here, to avoid redundant parsing to find out.
Returns
bool

Implements Content.

Definition at line 89 of file DummyNonTextContent.php.

◆ serialize()

DummyNonTextContent::serialize (   $format = null)
Since
1.21
Parameters
string | null$format
Returns
string
See also
Content::serialize

Reimplemented from AbstractContent.

Definition at line 11 of file DummyNonTextContent.php.

References data.

Referenced by fillParserOutput(), and getParserOutput().


The documentation for this class was generated from the following file: