Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
13 | public function resolve($object, array $args, $context, ResolveInfo $info) |
||
14 | { |
||
15 | $area = ElementalArea::get()->byID($args['ID']); |
||
16 | |||
17 | if (!$area) { |
||
|
|||
18 | throw new InvalidArgumentException('Could not find elemental area matching ID ' . $args['ID']); |
||
19 | } |
||
20 | |||
21 | if (!$area->canView($context['currentUser'])) { |
||
22 | throw new Exception('Current user cannot view element areas'); |
||
23 | } |
||
24 | |||
25 | return $area; |
||
26 | } |
||
28 |