1 | <?php namespace Arcanesoft\Sidebar; |
||
11 | class Collection extends BaseCollection |
||
12 | { |
||
13 | /* ----------------------------------------------------------------- |
||
14 | | Main Methods |
||
15 | | ----------------------------------------------------------------- |
||
16 | */ |
||
17 | |||
18 | /** |
||
19 | * Add a sidebar item. |
||
20 | * |
||
21 | * @param \Arcanesoft\Sidebar\Item $item |
||
22 | * |
||
23 | * @return $this |
||
24 | */ |
||
25 | 28 | public function add(Item $item) |
|
29 | |||
30 | /** |
||
31 | * Push multiple sidebar items into the collection. |
||
32 | * |
||
33 | * @param array $items |
||
34 | * |
||
35 | * @return $this |
||
36 | */ |
||
37 | 56 | public function addItems(array $items) |
|
45 | |||
46 | /** |
||
47 | * Push a new sidebar item to the collection. |
||
48 | * |
||
49 | * @param array $attributes |
||
50 | * |
||
51 | * @return $this |
||
52 | */ |
||
53 | 28 | public function addItem(array $attributes) |
|
57 | |||
58 | /** |
||
59 | * Set the selected item. |
||
60 | * |
||
61 | * @param string $name |
||
62 | * |
||
63 | * @return $this |
||
64 | */ |
||
65 | 12 | public function setSelected(string $name) |
|
71 | |||
72 | /* ----------------------------------------------------------------- |
||
73 | | Check Methods |
||
74 | | ----------------------------------------------------------------- |
||
75 | */ |
||
76 | |||
77 | /** |
||
78 | * Check if there is any item selected. |
||
79 | * |
||
80 | * @return bool |
||
81 | */ |
||
82 | 16 | public function hasAnySelected() : bool |
|
88 | } |
||
89 |