You are here

public function SearchApiEntity::getTargetEntityTypeId in Search API 8

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 couldn't be found.

1 call to SearchApiEntity::getTargetEntityTypeId()
SearchApiEntity::buildOptionsForm in src/Plugin/views/field/SearchApiEntity.php
Provide a form to edit options for this plugin.

File

src/Plugin/views/field/SearchApiEntity.php, line 195

Class

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

Namespace

Drupal\search_api\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');
}