Conditions | 5 |
Paths | 2 |
Total Lines | 30 |
Code Lines | 19 |
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 | /** @var \Drupal\graphql\Plugin\views\display\GraphQL $display */ |
||
25 | $display = $this->getViewDisplay($view, $displayId); |
||
26 | if (!$this->isPaged($display)) { |
||
27 | continue; |
||
28 | } |
||
29 | |||
30 | if (!$this->getRowResolveType($view, $displayId)) { |
||
|
|||
31 | continue; |
||
32 | } |
||
33 | |||
34 | $id = implode('-', [$viewId, $displayId, 'result', 'count']); |
||
35 | $this->derivatives[$id] = [ |
||
36 | 'id' => $id, |
||
37 | 'type' => 'Int', |
||
38 | 'parents' => [$display->getGraphQLResultName()], |
||
39 | 'view' => $viewId, |
||
40 | 'display' => $displayId, |
||
41 | ] + $this->getCacheMetadataDefinition($view) + $basePluginDefinition; |
||
42 | } |
||
43 | } |
||
44 | |||
45 | return parent::getDerivativeDefinitions($basePluginDefinition); |
||
46 | } |
||
47 | |||
49 |
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: