2015-04-15 08:26:22 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
class DummyContentHandlerForTesting extends ContentHandler {
|
|
|
|
|
|
2018-03-20 13:25:26 +00:00
|
|
|
public function __construct( $dataModel, $formats = [ DummyContentForTesting::MODEL_ID ] ) {
|
|
|
|
|
parent::__construct( $dataModel, $formats );
|
2015-04-15 08:26:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @see ContentHandler::serializeContent
|
|
|
|
|
*
|
|
|
|
|
* @param Content $content
|
2018-06-26 21:14:43 +00:00
|
|
|
* @param string|null $format
|
2015-04-15 08:26:22 +00:00
|
|
|
*
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
|
|
|
|
public function serializeContent( Content $content, $format = null ) {
|
|
|
|
|
return $content->serialize();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @see ContentHandler::unserializeContent
|
|
|
|
|
*
|
|
|
|
|
* @param string $blob
|
2018-06-26 21:14:43 +00:00
|
|
|
* @param string|null $format Unused.
|
2015-04-15 08:26:22 +00:00
|
|
|
*
|
|
|
|
|
* @return Content
|
|
|
|
|
*/
|
|
|
|
|
public function unserializeContent( $blob, $format = null ) {
|
|
|
|
|
$d = unserialize( $blob );
|
|
|
|
|
|
|
|
|
|
return new DummyContentForTesting( $d );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates an empty Content object of the type supported by this ContentHandler.
|
2017-09-09 20:47:04 +00:00
|
|
|
* @return DummyContentForTesting
|
2015-04-15 08:26:22 +00:00
|
|
|
*/
|
|
|
|
|
public function makeEmptyContent() {
|
|
|
|
|
return new DummyContentForTesting( '' );
|
|
|
|
|
}
|
|
|
|
|
}
|