1 | <?php |
||
9 | class JsonSerializer extends \SS_Object implements IRestSerializer { |
||
10 | |||
11 | /** |
||
12 | * @config |
||
13 | */ |
||
14 | private static $is_active = true; |
||
15 | |||
16 | /** |
||
17 | * The content type. |
||
18 | * @var string |
||
19 | */ |
||
20 | private $contentType = "application/json"; |
||
21 | |||
22 | /** |
||
23 | * Serializes the given data into a json string. |
||
24 | * |
||
25 | * @param array $data the data that should be serialized |
||
26 | * @return string a json formatted string |
||
27 | */ |
||
28 | public function serialize($data) { |
||
31 | |||
32 | public function contentType() { |
||
35 | |||
36 | /** |
||
37 | * Indicates if the serializer is active. |
||
38 | * Serializers can be deactivated to use another implementation for the same mime type. |
||
39 | * |
||
40 | * @return boolean |
||
41 | */ |
||
42 | public function active() { |
||
45 | } |
||
46 |