MediaWiki REL1_30
DummyContentHandlerForTesting.php
Go to the documentation of this file.
1<?php
2
4
5 public function __construct( $dataModel ) {
6 parent::__construct( $dataModel, [ "testing" ] );
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)
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.