| Total Complexity | 9 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | class Offer extends Simple |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * @var Price |
||
| 21 | */ |
||
| 22 | protected $prices = []; |
||
| 23 | protected $stockrooms = []; |
||
| 24 | protected $specifications = []; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @return array|SpecificationCollection |
||
| 28 | */ |
||
| 29 | 1 | public function getSpecifications() |
|
| 30 | { |
||
| 31 | 1 | if (empty($this->specifications)) { |
|
| 32 | 1 | $this->specifications = new SpecificationCollection($this->owner, $this->ХарактеристикиТовара); |
|
|
|
|||
| 33 | } |
||
| 34 | 1 | return $this->specifications; |
|
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @return Price |
||
| 39 | */ |
||
| 40 | 1 | public function getPrices() |
|
| 41 | { |
||
| 42 | 1 | if ($this->xml && empty($this->prices)) { |
|
| 43 | 1 | $this->prices = new Price($this->owner, $this->xml->Цены); |
|
| 44 | } |
||
| 45 | 1 | return $this->prices; |
|
| 46 | } |
||
| 47 | |||
| 48 | 1 | public function getStockrooms() |
|
| 49 | { |
||
| 50 | 1 | if ($this->xml && empty($this->stockrooms)) { |
|
| 51 | 1 | foreach ($this->xml->Склад as $stockroom) { |
|
| 52 | 1 | $this->stockrooms[] = new Stockroom($this->owner, $stockroom); |
|
| 53 | } |
||
| 54 | } |
||
| 55 | 1 | return $this->stockrooms; |
|
| 56 | } |
||
| 57 | } |