You are here

public function ElasticsearchViewsEntity::getTargetEntityTypeId in Elasticsearch Connector 8.2

Same name and namespace in other branches
  1. 8.7 modules/elasticsearch_connector_views/src/Plugin/views/field/ElasticsearchViewsEntity.php \Drupal\elasticsearch_connector_views\Plugin\views\field\ElasticsearchViewsEntity::getTargetEntityTypeId()
  2. 8.5 modules/elasticsearch_connector_views/src/Plugin/views/field/ElasticsearchViewsEntity.php \Drupal\elasticsearch_connector_views\Plugin\views\field\ElasticsearchViewsEntity::getTargetEntityTypeId()
  3. 8.6 modules/elasticsearch_connector_views/src/Plugin/views/field/ElasticsearchViewsEntity.php \Drupal\elasticsearch_connector_views\Plugin\views\field\ElasticsearchViewsEntity::getTargetEntityTypeId()

Return the entity type ID of the entity this field handler should display.

Return value

string|null The entity type ID, or NULL if it could not be found.

1 call to ElasticsearchViewsEntity::getTargetEntityTypeId()
ElasticsearchViewsEntity::buildOptionsForm in modules/elasticsearch_connector_views/src/Plugin/views/field/ElasticsearchViewsEntity.php
Default options form that provides the label widget that all fields should have.

File

modules/elasticsearch_connector_views/src/Plugin/views/field/ElasticsearchViewsEntity.php, line 159

Class

ElasticsearchViewsEntity
Handles the display of entity reference fields in Search API Views.

Namespace

Drupal\elasticsearch_connector_views\Plugin\views\field

Code

public function getTargetEntityTypeId() {
  $field_definition = $this
    ->getFieldDefinition();
  if ($field_definition
    ->getType() === 'field_item:comment') {
    return 'comment';
  }
  return $field_definition
    ->getSetting('target_type');
}