/**
* Serializes Content object of the type supported by this ContentHandler.
*
- * @FIXME: bad method name: suggests it serializes a ContentHandler, while in fact it serializes a Content object
- *
* @abstract
* @param Content $content the Content object to serialize
* @param null $format the desired serialization format
/**
* Unserializes a Content object of the type supported by this ContentHandler.
*
- * @FIXME: bad method name: suggests it unserializes a ContentHandler, while in fact it unserializes a Content object
- *
* @abstract
* @param $blob String serialized form of the content
* @param null $format the format used for serialization
/**
* Creates an empty Content object of the type supported by this ContentHandler.
*
- * @FIXME: bad method name: suggests it empties the content of an instance rather then creating a new empty one
*/
- public abstract function emptyContent();
+ public abstract function makeEmptyContent();
/**
* Returns the model name that identifies the content model this ContentHandler can handle.
}
if ( !$result ) {
- return $this->emptyContent();
+ return $this->makeEmptyContent();
}
$mergedContent = $this->unserializeContent( $result, $format );
return new WikitextContent( $text );
}
- public function emptyContent() {
+ public function makeEmptyContent() {
return new WikitextContent( '' );
}
return new JavaScriptContent( $text );
}
- public function emptyContent() {
+ public function makeEmptyContent() {
return new JavaScriptContent( '' );
}
}
return new CssContent( $text );
}
- public function emptyContent() {
+ public function makeEmptyContent() {
return new CssContent( '' );
}
if ( !$this->content_model ) $this->content_model = $this->getTitle()->getContentModelName();
$handler = ContentHandler::getForModelName( $this->content_model );
- return $handler->emptyContent();
+ return $handler->makeEmptyContent();
}
$content = $revision->getContent();
return $content;
if ( !$this->content_model ) $this->content_model = $this->getTitle()->getContentModelName();
$handler = ContentHandler::getForModelName( $this->content_model );
- return $handler->emptyContent();
+ return $handler->makeEmptyContent();
} else {
#FIXME: nasty side-effect!
$this->content_model = $rev->getContentModelName();
$handler = ContentHandler::getForTitle( $this->getTitle() );
if ( $preload === '' ) {
- return $handler->emptyContent();
+ return $handler->makeEmptyContent();
}
$title = Title::newFromText( $preload );
# Check for existence to avoid getting MediaWiki:Noarticletext
if ( $title === null || !$title->exists() || !$title->userCan( 'read' ) ) {
- return $handler->emptyContent();
+ return $handler->makeEmptyContent();
}
$page = WikiPage::factory( $title );
$title = $page->getRedirectTarget();
# Same as before
if ( $title === null || !$title->exists() || !$title->userCan( 'read' ) ) {
- return $handler->emptyContent();
+ return $handler->makeEmptyContent();
}
$page = WikiPage::factory( $title );
}