1 | <?php |
||
14 | class Breadcrumbs implements \Countable, \IteratorAggregate, \ArrayAccess |
||
15 | { |
||
16 | /** |
||
17 | * @var BreadcrumbsNode[] |
||
18 | */ |
||
19 | private $nodes = array(); |
||
20 | |||
21 | /** |
||
22 | * Add a node. |
||
23 | * |
||
24 | * @param string $path |
||
25 | * @param string $label |
||
26 | * |
||
27 | * @return BreadcrumbsNode |
||
28 | */ |
||
29 | public function add($path, $label) |
||
36 | |||
37 | /** |
||
38 | * @param BreadcrumbsNode $node |
||
39 | * |
||
40 | * @return Breadcrumbs |
||
41 | */ |
||
42 | public function addNode(BreadcrumbsNode $node) |
||
50 | |||
51 | /** |
||
52 | * {@inheritdoc} |
||
53 | */ |
||
54 | public function remove($index) |
||
65 | |||
66 | /** |
||
67 | * @param BreadcrumbsNode $node |
||
68 | * |
||
69 | * @return bool |
||
70 | */ |
||
71 | public function removeNode(BreadcrumbsNode $node) |
||
83 | |||
84 | /** |
||
85 | * @param BreadcrumbsNode $node |
||
86 | * |
||
87 | * @return bool |
||
88 | */ |
||
89 | public function containsNode(BreadcrumbsNode $node) |
||
93 | |||
94 | /** |
||
95 | * @return BreadcrumbsNode[] |
||
96 | */ |
||
97 | public function getNodes() |
||
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | public function count() |
||
109 | |||
110 | /** |
||
111 | * @return BreadcrumbsNode|bool |
||
112 | */ |
||
113 | public function first() |
||
117 | |||
118 | /** |
||
119 | * @return BreadcrumbsNode|bool |
||
120 | */ |
||
121 | public function last() |
||
125 | |||
126 | /** |
||
127 | * @return BreadcrumbsNode|bool |
||
128 | */ |
||
129 | public function current() |
||
133 | |||
134 | /** |
||
135 | * @return BreadcrumbsNode|bool |
||
136 | */ |
||
137 | public function next() |
||
141 | |||
142 | /** |
||
143 | * {@inheritdoc} |
||
144 | */ |
||
145 | public function getIterator() |
||
149 | |||
150 | /** |
||
151 | * {@inheritdoc} |
||
152 | */ |
||
153 | public function offsetExists($index) |
||
157 | |||
158 | /** |
||
159 | * {@inheritdoc} |
||
160 | */ |
||
161 | public function offsetGet($index) |
||
165 | |||
166 | /** |
||
167 | * {@inheritdoc} |
||
168 | */ |
||
169 | public function offsetSet($index, $value) |
||
177 | |||
178 | /** |
||
179 | * {@inheritdoc} |
||
180 | */ |
||
181 | public function offsetUnset($offset) |
||
185 | } |
||
186 |