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