| 1 | <?php |
||
| 4 | class BreadCrumb implements \IteratorAggregate |
||
| 5 | { |
||
| 6 | const LINK = 'link'; |
||
| 7 | const NAME = 'name'; |
||
| 8 | const LAST = 'last'; |
||
| 9 | |||
| 10 | private $breads = []; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var bool |
||
| 14 | */ |
||
| 15 | private $isLast; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param string $label |
||
| 19 | * @param string $link |
||
| 20 | */ |
||
| 21 | public function __construct($label, $link = null) |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param string $label |
||
| 32 | * @param string|null $link |
||
| 33 | * @return BreadCrumb |
||
| 34 | */ |
||
| 35 | public static function forge($label, $link = null) |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @param string $label |
||
| 42 | * @param string $link |
||
| 43 | * @return $this |
||
| 44 | */ |
||
| 45 | public function add($label, $link) |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @return array |
||
| 53 | */ |
||
| 54 | public function getReversed() |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @return bool |
||
| 65 | */ |
||
| 66 | public function isLast() |
||
| 72 | |||
| 73 | /** |
||
| 74 | * @return \Generator |
||
| 75 | */ |
||
| 76 | public function getIterator() |
||
| 87 | } |
||
| 88 |