1 | <?php |
||
24 | class ArrayCollection implements Collection |
||
25 | { /** |
||
|
|||
26 | * Holds the entries of the collection |
||
27 | * |
||
28 | * @var array |
||
29 | */ |
||
30 | protected $elements; |
||
31 | |||
32 | /** |
||
33 | * Collection constructor |
||
34 | * |
||
35 | * @param array $elements |
||
36 | */ |
||
37 | public function __construct(array $elements = array()) |
||
45 | |||
46 | /** |
||
47 | * @inheritDoc |
||
48 | */ |
||
49 | public function add($value) |
||
55 | |||
56 | /** |
||
57 | * @inheritDoc |
||
58 | */ |
||
59 | public function set($key, $value) |
||
69 | |||
70 | /** |
||
71 | * @inheritDoc |
||
72 | */ |
||
73 | public function exists($key) |
||
77 | |||
78 | /** |
||
79 | * @inheritDoc |
||
80 | */ |
||
81 | public function get($key) |
||
89 | |||
90 | /** |
||
91 | * @inheritDoc |
||
92 | */ |
||
93 | public function count() |
||
97 | |||
98 | } |
||
99 |