view = $view; $this->languageManager = $language_manager; $this->entityType = $entity_type; } /** * {@inheritdoc} */ public function getCacheMaxAge() { return Cache::PERMANENT; } /** * {@inheritdoc} */ public function getCacheContexts() { return []; } /** * {@inheritdoc} */ public function getCacheTags() { return []; } /** * Alters the query if needed. * * @param \Drupal\views\Plugin\views\query\QueryPluginBase $query * The query to alter. * @param string $relationship * (optional) The relationship, used by a field. */ abstract public function query(QueryPluginBase $query, $relationship = NULL); /** * Runs before each entity is rendered. * * @param $result * The full array of results from the query. */ public function preRender(array $result) { } /** * Renders entity data. * * @param \Drupal\views\ResultRow $row * A single row of the query result. * * @return array * A renderable array for the entity data contained in the result row. */ abstract public function render(ResultRow $row); }