Stockroom::propertyAliases()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Zenwalker\CommerceML\Model;
4
5
class Stockroom extends Simple
6
{
7
    private $_packageStockroom;
8
9 1
    public function getPackageStockroom()
10
    {
11 1
        if ($this->_packageStockroom) {
12
            return $this->_packageStockroom;
13
        }
14 1
        $id = $this->id;
15 1
        $xml = current($this->owner->offerPackage->xpath('//c:Склад[c:Ид = :id]', ['id' => $id]));
16 1
        return $this->_packageStockroom = new static($this->owner, $xml);
17
    }
18
19 1
    public function propertyAliases()
20
    {
21 1
        return array_merge(parent::propertyAliases(), [
22 1
            'ИдСклада' => 'id',
23
            'КоличествоНаСкладе' => 'count',
24
        ]);
25
    }
26
}