1 | <?php |
||
21 | class SimpleXmlWriter extends AbstractSendableWriter |
||
22 | { |
||
23 | /** |
||
24 | * @var SimpleHeaders |
||
25 | */ |
||
26 | protected $headers; |
||
27 | protected $php_54_compatibility = true; |
||
28 | |||
29 | /** |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $options = [ |
||
33 | /* |
||
34 | * XML tag for response |
||
35 | */ |
||
36 | 'body_tag' => 'response', |
||
37 | /* |
||
38 | * XML tag for rows |
||
39 | */ |
||
40 | 'row_tag' => 'row', |
||
41 | 'encoding' => 'UTF-8', |
||
42 | 'debug' => false |
||
43 | ]; |
||
44 | |||
45 | /** |
||
46 | * @param StoreInterface|null $store |
||
47 | * @param array|\Traversable|null $options |
||
48 | */ |
||
49 | 3 | public function __construct(StoreInterface $store = null, $options = null) |
|
57 | |||
58 | /** |
||
59 | * @param string $row_tag |
||
60 | * |
||
61 | * @return SimpleXmlWriter |
||
62 | */ |
||
63 | 1 | public function setRowTag($row_tag) |
|
69 | |||
70 | /** |
||
71 | * @param string $body_tag |
||
72 | * |
||
73 | * @return SimpleXmlWriter |
||
74 | */ |
||
75 | 1 | public function setBodyTag($body_tag) |
|
81 | |||
82 | /** |
||
83 | * @throws Exception\RuntimeException |
||
84 | * |
||
85 | * @param Options $options |
||
86 | * |
||
87 | * @return string xml encoded data |
||
88 | */ |
||
89 | 2 | public function getData(Options $options = null) |
|
126 | |||
127 | /** |
||
128 | * @param array $result |
||
129 | * @param SimpleXMLElement $xml |
||
130 | */ |
||
131 | 1 | protected function createXmlNode($result, SimpleXMLElement $xml) |
|
162 | |||
163 | /** |
||
164 | * Return default headers for sending store data via http. |
||
165 | * |
||
166 | * @return SimpleHeaders |
||
167 | */ |
||
168 | 1 | public function getHttpHeaders() |
|
178 | } |
||
179 |