| Total Complexity | 12 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class PropertyCollection extends Simple |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @param $id |
||
| 16 | * @return Product|null |
||
| 17 | */ |
||
| 18 | public function getById($id) |
||
| 26 | } |
||
| 27 | |||
| 28 | protected function loadPropertiesValue() |
||
| 29 | { |
||
| 30 | foreach ($this->xml->ЗначенияСвойства as $property) { |
||
| 31 | $properties = $this->owner->classifier->getProperties(); |
||
| 32 | $object = clone $properties->getById($property->Ид); |
||
| 33 | $object->productId = (string)$this->xpath('..')[0]->Ид; |
||
|
|
|||
| 34 | $object->init(); |
||
| 35 | $this->append($object); |
||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | protected function loadProperties() |
||
| 40 | { |
||
| 41 | foreach ($this->xml->Свойство as $property) { |
||
| 42 | $this->append(new Property($this->owner, $property)); |
||
| 43 | } |
||
| 44 | } |
||
| 45 | |||
| 46 | public function init() |
||
| 55 | } |
||
| 56 | } |