3 use MediaWiki\Content\AbstractContent
;
4 use MediaWiki\Content\Content
;
6 class DummyNonTextContent
extends AbstractContent
{
11 public function __construct( $data ) {
12 parent
::__construct( "testing-nontext" );
17 public function serialize( $format = null ) {
22 * @return string A string representing the content in a way useful for
23 * building a full text search index. If no useful representation exists,
24 * this method returns an empty string.
26 public function getTextForSearchIndex() {
31 * @return string|bool The wikitext to include when another page includes this content,
32 * or false if the content is not includable in a wikitext page.
34 public function getWikitextForTransclusion() {
39 * Returns a textual representation of the content suitable for use in edit
40 * summaries and log messages.
42 * @param int $maxlength Maximum length of the summary text.
43 * @return string The summary text.
45 public function getTextForSummary( $maxlength = 250 ) {
50 * Returns native representation of the data. Interpretation depends on the data model used,
51 * as given by getDataModel().
53 * @return mixed The native representation of the content. Could be a string, a nested array
54 * structure, an object, a binary blob... anything, really.
56 public function getNativeData() {
61 * returns the content's nominal size in bogo-bytes.
65 public function getSize() {
66 return strlen( $this->data
);
70 * Return a copy of this Content object. The following must be true for the object returned
71 * if $copy = $original->copy()
73 * * get_class($original) === get_class($copy)
74 * * $original->getModel() === $copy->getModel()
75 * * $original->equals( $copy )
77 * If and only if the Content object is immutable, the copy() method can and should
78 * return $this. That is, $copy === $original may be true, but only for imutable content
81 * @return Content A copy of this object
83 public function copy() {
88 * Returns true if this content is countable as a "real" wiki page, provided
89 * that it's also in a countable location (e.g. a current revision in the main namespace).
91 * @param bool|null $hasLinks If it is known whether this content contains links,
92 * provide this information here, to avoid redundant parsing to find out.
95 public function isCountable( $hasLinks = null ) {