MediaWiki REL1_40
FallbackContent.php
Go to the documentation of this file.
1<?php
39
41 private $data;
42
47 public function __construct( $data, $model_id ) {
48 parent::__construct( $model_id );
49
50 $this->data = $data;
51 }
52
56 public function copy() {
57 // FallbackContent is immutable, so no need to copy.
58 return $this;
59 }
60
68 public function getTextForSummary( $maxlength = 250 ) {
69 return '';
70 }
71
77 public function getSize() {
78 return strlen( $this->data );
79 }
80
89 public function isCountable( $hasLinks = null ) {
90 return false;
91 }
92
96 public function getNativeData() {
97 return $this->getData();
98 }
99
103 public function getData() {
104 return $this->data;
105 }
106
112 public function serialize( $format = null ) {
113 return $this->getData();
114 }
115
121 public function getTextForSearchIndex() {
122 return '';
123 }
124
128 public function getWikitextForTransclusion() {
129 return false;
130 }
131
137 public function convert( $toModel, $lossy = '' ) {
138 return false;
139 }
140
141 protected function equalsInternal( Content $that ) {
142 if ( !$that instanceof FallbackContent ) {
143 return false;
144 }
145
146 return $this->getData() == $that->getData();
147 }
148
149}
Base implementation for content objects.
string $model_id
Name of the content model this Content object represents.
Content object implementation representing unknown content.
__construct( $data, $model_id)
convert( $toModel, $lossy='')
getTextForSearchIndex()
Returns an empty string.
getTextForSummary( $maxlength=250)
Returns an empty string.
isCountable( $hasLinks=null)
Returns false.
getSize()
Returns the data size in bytes.
equalsInternal(Content $that)
Checks whether $that is logically equal to this Content object.
serialize( $format=null)
Base interface for representing page content.
Definition Content.php:37