1 | <?php |
||
13 | class SerializedEntitySerializer implements DispatchableSerializer { |
||
14 | |||
15 | /** |
||
16 | * @see Serializer::isSerializerFor |
||
17 | */ |
||
18 | 4 | public function isSerializerFor( $object ) { |
|
21 | |||
22 | /** |
||
23 | * @see Serializer::serialize |
||
24 | */ |
||
25 | 3 | public function serialize( $object ) { |
|
26 | 3 | if ( !$this->isSerializerFor( $object ) ) { |
|
27 | 1 | throw new UnsupportedObjectException( |
|
28 | 1 | $object, |
|
29 | 'SerializedEntitySerializer can only serialize SerializedEntity objects' |
||
30 | 1 | ); |
|
31 | } |
||
32 | |||
33 | 2 | return $this->getSerialized( $object ); |
|
34 | } |
||
35 | |||
36 | 2 | private function getSerialized( SerializedEntity $entity ) { |
|
39 | } |
||
40 |