| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 6 | public function execute() |
|
| 19 | { |
||
| 20 | 6 | $menu_id = $this->request->variable('menu_id', 0); |
|
| 21 | 6 | $parent_id = $this->request->variable('parent_id', 0); |
|
| 22 | 6 | $bulk_list = $this->request->variable('add_list', '', true); |
|
| 23 | |||
| 24 | 6 | $menu_mapper = $this->mapper_factory->create('menus'); |
|
| 25 | 6 | $items_mapper = $this->mapper_factory->create('items'); |
|
| 26 | |||
| 27 | 6 | if ($menu_mapper->load(array('menu_id', '=', $menu_id)) === null) |
|
| 28 | 6 | { |
|
| 29 | 1 | throw new \blitze\sitemaker\exception\out_of_bounds('menu_id'); |
|
| 30 | } |
||
| 31 | |||
| 32 | /** @type \blitze\sitemaker\model\mapper\items $items_mapper */ |
||
| 33 | 5 | $collection = $items_mapper->add_items($menu_id, $parent_id, $bulk_list); |
|
| 34 | |||
| 35 | 3 | return $this->get_items($collection); |
|
| 36 | } |
||
| 38 |