Conditions | 4 |
Paths | 2 |
Total Lines | 30 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function getDerivativeDefinitions($basePluginDefinition) { |
||
18 | if ($this->entityTypeManager->hasDefinition('view')) { |
||
19 | $viewStorage = $this->entityTypeManager->getStorage('view'); |
||
20 | |||
21 | foreach (Views::getApplicableViews('graphql_display') as list($viewId, $displayId)) { |
||
22 | /** @var \Drupal\views\ViewEntityInterface $view */ |
||
23 | $view = $viewStorage->load($viewId); |
||
24 | if (!$type = $this->getRowResolveType($view, $displayId)) { |
||
25 | continue; |
||
26 | } |
||
27 | |||
28 | /** @var \Drupal\graphql\Plugin\views\display\GraphQL $display */ |
||
29 | $display = $this->getViewDisplay($view, $displayId); |
||
30 | |||
31 | $id = implode('-', [$viewId, $displayId, 'result', 'list']); |
||
32 | $style = $this->getViewStyle($view, $displayId); |
||
33 | $this->derivatives[$id] = [ |
||
34 | 'id' => $id, |
||
35 | 'type' => $type, |
||
36 | 'parents' => [$display->getGraphQLResultName()], |
||
37 | 'multi' => TRUE, |
||
38 | 'view' => $viewId, |
||
39 | 'display' => $displayId, |
||
40 | 'uses_fields' => $style->usesFields(), |
||
41 | ] + $this->getCacheMetadataDefinition($view) + $basePluginDefinition; |
||
42 | } |
||
43 | } |
||
44 | |||
45 | return parent::getDerivativeDefinitions($basePluginDefinition); |
||
46 | } |
||
47 | |||
49 |