Conditions | 3 |
Paths | 3 |
Total Lines | 23 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3 |
Changes | 6 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
18 | 4 | public function execute() |
|
19 | { |
||
20 | 4 | $menu_id = $this->request->variable('menu_id', 0); |
|
21 | |||
22 | if ($menu_id) |
||
23 | 4 | { |
|
24 | 3 | $menu_mapper = $this->mapper_factory->create('menus', 'menus'); |
|
25 | |||
26 | /** @type \blitze\sitemaker\model\menus\entity\menu $entity */ |
||
27 | 3 | if (($entity = $menu_mapper->load(array('menu_id', '=', $menu_id))) === null) |
|
28 | 3 | { |
|
29 | 1 | throw new \blitze\sitemaker\exception\out_of_bounds('MENU_NOT_FOUND'); |
|
30 | } |
||
31 | |||
32 | 2 | $collection = $entity->get_items(); |
|
33 | |||
34 | 2 | return $this->get_items($collection); |
|
35 | } |
||
36 | |||
37 | return array( |
||
38 | 1 | 'items' => array() |
|
39 | 1 | ); |
|
40 | } |
||
41 | } |
||
42 |