Total Complexity | 9 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
18 | class MenuItems extends Eloquent |
||
19 | { |
||
20 | |||
21 | protected $table = null; |
||
22 | |||
23 | public function __construct( array $attributes = [] ){ |
||
24 | //parent::construct( $attributes ); |
||
25 | $this->table = config('menu.table_prefix') . config('menu.table_name_items'); |
||
26 | } |
||
27 | |||
28 | public function getsons($id) { |
||
29 | return $this -> where("parent", $id) -> get(); |
||
30 | } |
||
31 | public function getall($id) { |
||
32 | return $this -> where("menu", $id) -> orderBy("sort", "asc")->get(); |
||
33 | } |
||
34 | |||
35 | public static function getNextSortRoot($menu){ |
||
36 | return self::where('menu',$menu)->max('sort') + 1; |
||
37 | } |
||
38 | |||
39 | public function getLinkAttribute() |
||
46 | } |
||
47 | } |
||
48 | |||
49 | public function getRawLinkAttribute() |
||
52 | } |
||
53 | |||
54 | public function getTypeAttribute() |
||
60 | } |
||
61 | } |
||
62 | |||
63 | } |
||
64 |