1 | <?php namespace Arcanedev\Breadcrumbs\Entities; |
||
11 | class BreadcrumbCollection extends Collection |
||
12 | { |
||
13 | /* ----------------------------------------------------------------- |
||
14 | | Main Methods |
||
15 | | ----------------------------------------------------------------- |
||
16 | */ |
||
17 | |||
18 | /** |
||
19 | * Add a breadcrumb item to collection. |
||
20 | * |
||
21 | * @param string $title |
||
22 | * @param string $url |
||
23 | * @param array $data |
||
24 | * |
||
25 | * @return self |
||
26 | */ |
||
27 | 28 | public function addOne($title, $url, array $data = []) |
|
33 | |||
34 | /** |
||
35 | * Add a breadcrumb item to collection. |
||
36 | * |
||
37 | * @param BreadcrumbItem $breadcrumb |
||
38 | * |
||
39 | * @return self |
||
40 | */ |
||
41 | 28 | public function addBreadcrumb(BreadcrumbItem $breadcrumb) |
|
42 | { |
||
43 | 28 | $this->push($breadcrumb); |
|
44 | |||
45 | 28 | return $this->order(); |
|
46 | } |
||
47 | |||
48 | /* ----------------------------------------------------------------- |
||
49 | | Other Methods |
||
50 | | ----------------------------------------------------------------- |
||
51 | */ |
||
52 | |||
53 | /** |
||
54 | * Order all breadcrumbs items. |
||
55 | * |
||
56 | * @return self |
||
57 | */ |
||
58 | 28 | private function order() |
|
76 | } |
||
77 |