/** * Determines whether this renderer can handle the given field. * * @param \Drupal\views\Plugin\views\field\FieldHandlerInterface $field * The field for which to check compatibility. * * @return bool * TRUE if this renderer can handle the given field, FALSE otherwise. * * @see EntityFieldRenderer::getRenderableFieldIds() */ public function compatibleWithField(FieldHandlerInterface $field) { if ($field instanceof SearchApiEntityField && $field->relationship == $this->relationship) { // If there is no relationship set, we also need to compare the // datasource ID. if ($field->relationship || $field->getDatasourceId() == $this->datasourceId) { return TRUE; } } return FALSE; }
/** * {@inheritdoc} */ public function renderItems($items) { if (!$this->options['field_rendering']) { if ($this->fallbackHandler instanceof MultiItemsFieldHandlerInterface) { return $this->fallbackHandler->renderItems($items); } return ''; } return parent::renderItems($items); }