1 | <?php |
||
15 | abstract class AbstractOutput |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * Holds the media-type . |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $content_type = null; |
||
23 | |||
24 | /** |
||
25 | * Encode an array of data. |
||
26 | * |
||
27 | * @param array $data Response data to encode |
||
28 | * @param string|null $rootNode The rootNode element. |
||
29 | * @return string |
||
30 | */ |
||
31 | abstract public function encode(array $data, $rootNode=null); |
||
32 | |||
33 | /** |
||
34 | * Returns the content-type. |
||
35 | * |
||
36 | * @return string |
||
37 | * @throws \RuntimeException If self::contentType === null |
||
38 | */ |
||
39 | public function getContentType() |
||
47 | |||
48 | } |
||
49 |