1 | <?php |
||
23 | class Basic implements CollectionInterface |
||
24 | { |
||
25 | /** |
||
26 | * The events. |
||
27 | * |
||
28 | * @var EventInterface[] |
||
29 | */ |
||
30 | protected $events; |
||
31 | |||
32 | /** |
||
33 | * @param EventInterface[] $events |
||
34 | */ |
||
35 | public function __construct(array $events = array()) |
||
39 | |||
40 | /** |
||
41 | * Adds an event to the collection. |
||
42 | * |
||
43 | * @param EventInterface $event |
||
44 | */ |
||
45 | public function add(EventInterface $event) |
||
49 | |||
50 | /** |
||
51 | * Removes an event from the collection. |
||
52 | * |
||
53 | * @param EventInterface $event |
||
54 | */ |
||
55 | public function remove(EventInterface $event) |
||
63 | |||
64 | /** |
||
65 | * Return all events;. |
||
66 | * |
||
67 | * @return EventInterface[] |
||
68 | */ |
||
69 | public function all() |
||
73 | |||
74 | /** |
||
75 | * Returns if there is events corresponding to $index period. |
||
76 | * |
||
77 | * @param mixed $index |
||
78 | * |
||
79 | * @return bool |
||
80 | */ |
||
81 | public function has($index) |
||
85 | |||
86 | /** |
||
87 | * Find events in the collection. |
||
88 | * |
||
89 | * @param mixed $index |
||
90 | * |
||
91 | * @return EventInterface[] |
||
92 | */ |
||
93 | public function find($index) |
||
106 | |||
107 | /** |
||
108 | * @return int |
||
109 | */ |
||
110 | public function count() |
||
114 | } |
||
115 |