MediaWiki REL1_31
DummyContentHandlerForTesting.php
Go to the documentation of this file.
1<?php
2
4
5 public function __construct( $dataModel, $formats = [ DummyContentForTesting::MODEL_ID ] ) {
6 parent::__construct( $dataModel, $formats );
7 }
8
17 public function serializeContent( Content $content, $format = null ) {
18 return $content->serialize();
19 }
20
29 public function unserializeContent( $blob, $format = null ) {
30 $d = unserialize( $blob );
31
32 return new DummyContentForTesting( $d );
33 }
34
39 public function makeEmptyContent() {
40 return new DummyContentForTesting( '' );
41 }
42}
unserialize( $serialized)
A content handler knows how do deal with a specific type of content on a wiki page.
serializeContent(Content $content, $format=null)
__construct( $dataModel, $formats=[DummyContentForTesting::MODEL_ID])
Constructor, initializing the ContentHandler instance with its model ID and a list of supported forma...
makeEmptyContent()
Creates an empty Content object of the type supported by this ContentHandler.
Base interface for content objects.
Definition Content.php:34
serialize( $format=null)
Convenience method for serializing this Content object.