Conditions | 4 |
Paths | 2 |
Total Lines | 26 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public function getDerivativeDefinitions($basePluginDefinition) { |
||
17 | if ($this->entityTypeManager->hasDefinition('view')) { |
||
18 | $viewStorage = $this->entityTypeManager->getStorage('view'); |
||
19 | |||
20 | foreach (Views::getApplicableViews('graphql_display') as list($viewId, $displayId)) { |
||
21 | /** @var \Drupal\views\ViewEntityInterface $view */ |
||
22 | $view = $viewStorage->load($viewId); |
||
23 | if (!$this->getRowResolveType($view, $displayId)) { |
||
|
|||
24 | continue; |
||
25 | } |
||
26 | |||
27 | /** @var \Drupal\graphql_views\Plugin\views\display\GraphQL $display */ |
||
28 | $display = $this->getViewDisplay($view, $displayId); |
||
29 | |||
30 | $id = implode('-', [$viewId, $displayId, 'result']); |
||
31 | $this->derivatives[$id] = [ |
||
32 | 'id' => $id, |
||
33 | 'name' => $display->getGraphQLResultName(), |
||
34 | 'view' => $viewId, |
||
35 | 'display' => $displayId, |
||
36 | ] + $this->getCacheMetadataDefinition($view, $display) + $basePluginDefinition; |
||
37 | } |
||
38 | } |
||
39 | |||
40 | return parent::getDerivativeDefinitions($basePluginDefinition); |
||
41 | } |
||
42 | |||
44 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: