data = $data; } /** * @return Content $this */ public function copy() { // UnknownContent is immutable, so no need to copy. return $this; } /** * Returns an empty string. * * @param int $maxlength * * @return string */ public function getTextForSummary( $maxlength = 250 ) { return ''; } /** * Returns the data size in bytes. * * @return int */ public function getSize() { return strlen( $this->data ); } /** * Returns false. * * @param bool|null $hasLinks If it is known whether this content contains links, * provide this information here, to avoid redundant parsing to find out. * * @return bool */ public function isCountable( $hasLinks = null ) { return false; } /** * @return string data of unknown format and meaning */ public function getNativeData() { return $this->getData(); } /** * @return string data of unknown format and meaning */ public function getData() { return $this->data; } /** * Returns an empty string. * * @return string The raw text. */ public function getTextForSearchIndex() { return ''; } /** * Returns false. */ public function getWikitextForTransclusion() { return false; } /** * Fills the ParserOutput with an error message. */ protected function fillParserOutput( Title $title, $revId, ParserOptions $options, $generateHtml, ParserOutput &$output ) { $msg = wfMessage( 'unsupported-content-model', [ $this->getModel() ] ); $html = Html::rawElement( 'div', [ 'class' => 'error' ], $msg->inContentLanguage()->parse() ); $output->setText( $html ); } /** * Returns false. */ public function convert( $toModel, $lossy = '' ) { return false; } protected function equalsInternal( Content $that ) { if ( !$that instanceof UnknownContent ) { return false; } return $this->getData() == $that->getData(); } }