EntityList::getList()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * @category    Brownie/CartsGuru
4
 * @author      Brownie <[email protected]>
5
 * @license     http://www.gnu.org/copyleft/lesser.html
6
 */
7
8
namespace Brownie\CartsGuru\Model\Base;
9
10
/**
11
 * Entity storage.
12
 */
13
abstract class EntityList
14
{
15
16
    private $list;
17
18 3
    public function __construct()
19
    {
20 3
        $this->createList();
21 3
    }
22
23 3
    private function createList()
24
    {
25 3
        $this->list = new \ArrayIterator(array());
26 3
    }
27
28
    /**
29
     * @return \ArrayIterator
30
     */
31 3
    private function getList()
32
    {
33 3
        return $this->list;
34
    }
35
36 3
    public function append($entity)
37
    {
38 3
        $this->getList()->append($entity);
39 3
    }
40
41 1
    public function getKeyName()
42
    {
43 1
        return $this->keyName;
44
    }
45
46 3
    public function toArray()
47
    {
48 3
        return $this->getList()->getArrayCopy();
49
    }
50
51 1
    public function count()
52
    {
53 1
        return $this->getList()->count();
54
    }
55
}
56