}
$handler = ContentHandler::getForModelName( $modelName );
- return $handler->unserialize( $text, $format );
+ return $handler->unserializeContent( $text, $format );
}
/**
* @param null $format the desired serialization format
* @return String serialized form of the content
*/
- public abstract function serialize( Content $content, $format = null );
+ public abstract function serializeContent( Content $content, $format = null );
/**
* Unserializes a Content object of the type supported by this ContentHandler.
* @param null $format the format used for serialization
* @return Content the Content object created by deserializing $blob
*/
- public abstract function unserialize( $blob, $format = null );
+ public abstract function unserializeContent( $blob, $format = null );
/**
* Creates an empty Content object of the type supported by this ContentHandler.
}
/**
- * Returns a list of serialization formats supported by the serialize() and unserialize() methods of
+ * Returns a list of serialization formats supported by the serializeContent() and unserializeContent() methods of
* this ContentHandler.
*
* @return array of serialization formats as MIME type like strings
parent::__construct( $modelName, $formats );
}
- public function serialize( Content $content, $format = null ) {
+ public function serializeContent( Content $content, $format = null ) {
$this->checkFormat( $format );
return $content->getNativeData();
}
$format = $this->getDefaultFormat();
- $old = $this->serialize( $oldContent, $format );
- $mine = $this->serialize( $myContent, $format );
- $yours = $this->serialize( $yourContent, $format );
+ $old = $this->serializeContent( $oldContent, $format );
+ $mine = $this->serializeContent( $myContent, $format );
+ $yours = $this->serializeContent( $yourContent, $format );
$ok = wfMerge( $old, $mine, $yours, $result );
return $this->emptyContent();
}
- $mergedContent = $this->unserialize( $result, $format );
+ $mergedContent = $this->unserializeContent( $result, $format );
return $mergedContent;
}
parent::__construct( $modelName, array( 'application/x-wikitext' ) ); #FIXME: mime
}
- public function unserialize( $text, $format = null ) {
+ public function unserializeContent( $text, $format = null ) {
$this->checkFormat( $format );
return new WikitextContent( $text );
parent::__construct( $modelName, array( 'text/javascript' ) ); #XXX: or use $wgJsMimeType? this is for internal storage, not HTTP...
}
- public function unserialize( $text, $format = null ) {
+ public function unserializeContent( $text, $format = null ) {
return new JavaScriptContent( $text );
}
parent::__construct( $modelName, array( 'text/css' ) );
}
- public function unserialize( $text, $format = null ) {
+ public function unserializeContent( $text, $format = null ) {
return new CssContent( $text );
}
if ( $txt !== $content_text ) {
# if the text changed, unserialize the new version to create an updated Content object.
- $content = $content->getContentHandler()->unserialize( $txt );
+ $content = $content->getContentHandler()->unserializeContent( $txt );
}
}
# NOTE: stub for backwards-compatibility. assumes the given text is wikitext. will break horribly if it isn't.
$handler = ContentHandler::getForModelName( CONTENT_MODEL_WIKITEXT );
- $oldContent = $oldtext ? $handler->unserialize( $oldtext ) : null;
- $newContent = $newtext ? $handler->unserialize( $newtext ) : null;
+ $oldContent = $oldtext ? $handler->unserializeContent( $oldtext ) : null;
+ $newContent = $newtext ? $handler->unserializeContent( $newtext ) : null;
return $handler->getAutosummary( $oldContent, $newContent, $flags );
}