Files
AnatImageViewer/includes/AnnotationContent.php
2026-05-18 18:13:20 -07:00

60 lines
1.3 KiB
PHP

<?php
namespace MediaWiki\Extension\AnatImageViewer;
use Content;
use TextContent;
class AnnotationContent extends TextContent {
public const MODEL = 'annotation';
/** @inheritDoc */
public function __construct( $text, $model_id = self::MODEL ) {
parent::__construct( $text, $model_id );
}
/**
* Determines whether this content can be considered empty.
*
* @return bool
*/
public function isEmpty() {
$text = trim( strip_tags( $this->getText() ) );
return $text === '';
}
/**
* Determines whether this content should be counted as a "page" for the wiki's statistics.
*
* @param bool|null $hasLinks
*
* @return bool
*/
public function isCountable( $hasLinks = null ) {
return false;
}
public function isValid() {
return parent::isValid();
}
/**
* Should return text relevant to the wiki's search index.
*
* @return string
*/
public function getTextForSearchIndex() {
return strip_tags( $this->getText() );
}
public function convert( $toModel, $lossy = '' ) {
return parent::convert( $toModel, $lossy );
}
public function getSection( $sectionId ) {
return parent::getSection( $sectionId );
}
public function replaceSection( $sectionId, Content $with, $sectionTitle = '' ) {
return parent::replaceSection( $sectionId, $with, $sectionTitle );
}
}