1 | <?php namespace Arcanedev\Menus\Entities; |
||
11 | class MenuItemCollection extends Collection |
||
12 | { |
||
13 | /* ------------------------------------------------------------------------------------------------ |
||
14 | | Main Functions |
||
15 | | ------------------------------------------------------------------------------------------------ |
||
16 | */ |
||
17 | /** |
||
18 | * Get a menu item from the collection by key. |
||
19 | * |
||
20 | * @param mixed $key |
||
21 | * @param mixed $default |
||
22 | * |
||
23 | * @return \Arcanedev\Menus\Entities\MenuItem|mixed |
||
24 | */ |
||
25 | 16 | public function get($key, $default = null) |
|
29 | |||
30 | /** |
||
31 | * Get the first item from the collection. |
||
32 | * |
||
33 | * @param callable|null $callback |
||
34 | * @param mixed $default |
||
35 | * |
||
36 | * @return \Arcanedev\Menus\Entities\MenuItem|mixed |
||
37 | */ |
||
38 | 8 | public function first(callable $callback = null, $default = null) |
|
42 | |||
43 | /** |
||
44 | * Get the last item from the collection. |
||
45 | * |
||
46 | * @param callable|null $callback |
||
47 | * @param mixed $default |
||
48 | * |
||
49 | * @return \Arcanedev\Menus\Entities\MenuItem|mixed |
||
50 | */ |
||
51 | 8 | public function last(callable $callback = null, $default = null) |
|
55 | } |
||
56 |