MediaWiki master
FallbackContent.php
Go to the documentation of this file.
1<?php
7namespace MediaWiki\Content;
8
22
24 private $data;
25
30 public function __construct( $data, $model_id ) {
31 parent::__construct( $model_id );
32
33 $this->data = $data;
34 }
35
39 public function copy() {
40 // FallbackContent is immutable, so no need to copy.
41 return $this;
42 }
43
51 public function getTextForSummary( $maxlength = 250 ) {
52 return '';
53 }
54
60 public function getSize() {
61 return strlen( $this->data );
62 }
63
72 public function isCountable( $hasLinks = null ) {
73 return false;
74 }
75
79 public function getNativeData() {
80 return $this->getData();
81 }
82
86 public function getData() {
87 return $this->data;
88 }
89
95 public function serialize( $format = null ) {
96 return $this->getData();
97 }
98
104 public function getTextForSearchIndex() {
105 return '';
106 }
107
111 public function getWikitextForTransclusion() {
112 return false;
113 }
114
120 public function convert( $toModel, $lossy = '' ) {
121 return false;
122 }
123
125 protected function equalsInternal( Content $that ) {
126 if ( !$that instanceof FallbackContent ) {
127 return false;
128 }
129
130 return $this->getData() == $that->getData();
131 }
132
133}
135class_alias( FallbackContent::class, 'FallbackContent' );
Base class for all Content objects.
Content object implementation representing unknown content.
getTextForSearchIndex()
Returns an empty string.
isCountable( $hasLinks=null)
Returns false.
equalsInternal(Content $that)
Helper for AbstractContent::equals.Do not call this method directly, call Content::equals() instead....
getSize()
Returns the data size in bytes.
getTextForSummary( $maxlength=250)
Returns an empty string.
Content objects represent page content, e.g.
Definition Content.php:28