1 | <?php |
||
24 | class GraphQLEntityRow extends RowPluginBase { |
||
25 | |||
26 | use EntityTranslationRenderTrait { |
||
27 | getEntityTranslationRenderer as getEntityTranslationRendererBase; |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * {@inheritdoc} |
||
32 | */ |
||
33 | protected $usesOptions = FALSE; |
||
34 | |||
35 | /** |
||
36 | * Contains the entity type of this row plugin instance. |
||
37 | * |
||
38 | * @var \Drupal\Core\Entity\EntityTypeInterface |
||
39 | */ |
||
40 | protected $entityType; |
||
41 | |||
42 | /** |
||
43 | * The entity type bundle info. |
||
44 | * |
||
45 | * @var \Drupal\Core\Entity\EntityTypeBundleInfo |
||
46 | */ |
||
47 | protected $entityTypeBundleInfo; |
||
48 | |||
49 | /** |
||
50 | * The language manager. |
||
51 | * |
||
52 | * @var \Drupal\Core\Language\LanguageManagerInterface |
||
53 | */ |
||
54 | protected $languageManager; |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | * |
||
59 | * @param \Drupal\Core\Entity\EntityTypeBundleInfo $entityTypeBundleInfo |
||
60 | * The entity type manager. |
||
61 | * @param \Drupal\Core\Language\LanguageManagerInterface $languageManager |
||
62 | * The language manager. |
||
63 | */ |
||
64 | public function __construct(array $configuration, $pluginId, $pluginDefinition, EntityTypeBundleInfo $entityTypeBundleInfo, LanguageManagerInterface $languageManager) { |
||
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | public static function create(ContainerInterface $container, array $configuration, $pluginId, $pluginDefinition) { |
||
83 | |||
84 | /** |
||
85 | * {@inheritdoc} |
||
86 | */ |
||
87 | public function render($row) { |
||
94 | |||
95 | /** |
||
96 | * {@inheritdoc} |
||
97 | */ |
||
98 | protected function getEntityTranslationRenderer() { |
||
105 | |||
106 | /** |
||
107 | * {@inheritdoc} |
||
108 | */ |
||
109 | public function getEntityTypeId() { |
||
116 | |||
117 | /** |
||
118 | * {@inheritdoc} |
||
119 | */ |
||
120 | protected function getEntityTypeBundleInfo() { |
||
121 | return $this->entityTypeBundleInfo; |
||
122 | } |
||
123 | |||
124 | /** |
||
125 | * {@inheritdoc} |
||
126 | */ |
||
127 | protected function getLanguageManager() { |
||
130 | |||
131 | /** |
||
132 | * Retrieves the entity object from a result row. |
||
133 | * |
||
134 | * @param \Drupal\Views\ResultRow $row |
||
135 | * The views result row object. |
||
136 | * |
||
137 | * @return null|\Drupal\Core\Entity\EntityInterface |
||
138 | * The extracted entity object or NULL if it could not be retrieved. |
||
139 | */ |
||
140 | protected function getEntityFromRow(ResultRow $row) { |
||
151 | |||
152 | /** |
||
153 | * {@inheritdoc} |
||
154 | */ |
||
155 | protected function getView() { |
||
158 | |||
159 | /** |
||
160 | * {@inheritdoc} |
||
161 | */ |
||
162 | public function query() { |
||
169 | |||
170 | } |
||
171 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.