1 | <?php |
||
7 | class XmlSerializer extends Object implements IRestSerializer { |
||
|
|||
8 | |||
9 | /** |
||
10 | * @config |
||
11 | */ |
||
12 | private static $is_active = true; |
||
13 | |||
14 | /** |
||
15 | * The content type. |
||
16 | * @var string |
||
17 | */ |
||
18 | private $contentType = "application/xml"; |
||
19 | |||
20 | /** |
||
21 | * Serializes the given data into a xml string. |
||
22 | * |
||
23 | * @param array $data the data that should be serialized |
||
24 | * @return string a xml formatted string |
||
25 | */ |
||
26 | public function serialize($data) { |
||
31 | |||
32 | public function contentType() { |
||
35 | |||
36 | private function toXml(SimpleXMLElement $object, array $data) { |
||
49 | |||
50 | /** |
||
51 | * Indicates if the serializer is active. |
||
52 | * Serializers can be deactivated to use another implementation for the same mime type. |
||
53 | * |
||
54 | * @return boolean |
||
55 | */ |
||
56 | public function active() { |
||
59 | } |
||
60 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.