| @@ 183-197 (lines=15) @@ | ||
| 180 | /** |
|
| 181 | * @return array|bool |
|
| 182 | */ |
|
| 183 | public function parseProduct() |
|
| 184 | { |
|
| 185 | if (null === $this->xml) { |
|
| 186 | return []; |
|
| 187 | } |
|
| 188 | $xml = $this->xml; |
|
| 189 | ||
| 190 | while ($xml->read()) { |
|
| 191 | if (\XMLReader::END_ELEMENT === $xml->nodeType && static::NODE_TOVARY === $xml->name) { |
|
| 192 | return true; |
|
| 193 | } elseif (\XMLReader::ELEMENT === $xml->nodeType && static::NODE_TOVAR === $xml->name) { |
|
| 194 | $this->createProduct($this->parseTovar()); |
|
| 195 | } |
|
| 196 | } |
|
| 197 | } |
|
| 198 | ||
| 199 | /** |
|
| 200 | * @return array |
|
| @@ 301-315 (lines=15) @@ | ||
| 298 | } |
|
| 299 | } |
|
| 300 | ||
| 301 | public function parseOffers() |
|
| 302 | { |
|
| 303 | if (null === $this->xml) { |
|
| 304 | return []; |
|
| 305 | } |
|
| 306 | $xml = $this->xml; |
|
| 307 | ||
| 308 | while ($xml->read()) { |
|
| 309 | if (\XMLReader::END_ELEMENT === $xml->nodeType && static::NODE_PREDLOZHENIYA === $xml->name) { |
|
| 310 | return true; |
|
| 311 | } elseif (\XMLReader::ELEMENT === $xml->nodeType && static::NODE_PREDLOZHENIE === $xml->name) { |
|
| 312 | $this->createProduct($this->parsePredlozhenie(), false); |
|
| 313 | } |
|
| 314 | } |
|
| 315 | } |
|
| 316 | ||
| 317 | public function parsePredlozhenie() |
|
| 318 | { |
|