1 | <?php |
||
10 | class SimpleXML implements DriverInterface { |
||
11 | |||
12 | /** |
||
13 | * @var \SimpleXMLElement |
||
14 | */ |
||
15 | private $xml; |
||
16 | |||
17 | /** |
||
18 | * Gets categories. |
||
19 | * |
||
20 | * @return arry Array of \YMLParser\Node\Category instances or empty array |
||
21 | */ |
||
22 | public function getCategories() { |
||
36 | |||
37 | /** |
||
38 | * Gets offers. |
||
39 | * |
||
40 | * @param \Closure $filter Anonymous function |
||
41 | * |
||
42 | * @return \Iterator Array of of \YMLParser\Node\Offer instances or empty array |
||
43 | */ |
||
44 | public function getOffers(\Closure $filter = null) { |
||
70 | |||
71 | /** |
||
72 | * Gets currencies. |
||
73 | * |
||
74 | * @return array |
||
75 | */ |
||
76 | public function getCurrencies() { |
||
91 | |||
92 | /** |
||
93 | * Gets amount of offers. |
||
94 | * |
||
95 | * @return int |
||
96 | */ |
||
97 | public function countOffers(\Closure $filter = null) { |
||
106 | |||
107 | /** |
||
108 | * Opens filename. |
||
109 | * |
||
110 | * @param string $filename |
||
111 | * |
||
112 | * @return bool |
||
113 | */ |
||
114 | public function open($filename) { |
||
120 | |||
121 | /** |
||
122 | * Gets element params. |
||
123 | * |
||
124 | * @param \SimpleXMLElement $offer |
||
125 | * |
||
126 | * @return array |
||
127 | */ |
||
128 | private function parseParamsFromElement(\SimpleXMLElement $offer) { |
||
142 | |||
143 | /** |
||
144 | * Gets element pictures. |
||
145 | * |
||
146 | * @param \SimpleXMLElement $offer |
||
147 | * |
||
148 | * @return array |
||
149 | */ |
||
150 | private function parsePicturesFromElement(\SimpleXMLElement $offer) { |
||
162 | |||
163 | /** |
||
164 | * Gets lement attributes. |
||
165 | * |
||
166 | * @param \SimpleXMLElement $element |
||
167 | * |
||
168 | * @return array |
||
169 | */ |
||
170 | private function getElementAttributes(\SimpleXMLElement $element) { |
||
179 | |||
180 | } |
||
181 |