Conditions | 7 |
Paths | 6 |
Total Lines | 22 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | public function resolveValues($value, array $args, ResolveInfo $info) { |
||
26 | if ($value instanceof FieldableEntityInterface) { |
||
27 | $fieldName = $this->getPluginDefinition()['field']; |
||
28 | if ($value->hasField($fieldName)) { |
||
29 | /** @var \Drupal\Core\Field\FieldItemListInterface $items */ |
||
30 | $items = $value->get($fieldName); |
||
31 | |||
32 | if (($access = $items->access('view', NULL, TRUE)) && $access->isAllowed()) { |
||
33 | $this->commitCacheableDependency($info, $access); |
||
34 | |||
35 | foreach ($items as $item) { |
||
36 | if (!empty($this->getPluginDefinition()['property'])) { |
||
37 | yield $this->resolveItem($item, $args, $info); |
||
38 | } |
||
39 | else { |
||
40 | yield $item; |
||
41 | } |
||
42 | } |
||
43 | } |
||
44 | } |
||
45 | } |
||
46 | } |
||
47 | |||
49 |