You are here

public function EntityReference::getTargetEntityId in Reference Table Formatter 8

Get the entity which is the target of the reference field.

Parameters

\Drupal\Core\Field\FieldDefinitionInterface $field_definition: The field definition.

Return value

string The entity which is the target of the reference.

Overrides FormatterInterface::getTargetEntityId

1 call to EntityReference::getTargetEntityId()
EntityReference::getTargetBundleId in src/Plugin/Field/FieldFormatter/EntityReference.php
Get the target bundle from a reference field.

File

src/Plugin/Field/FieldFormatter/EntityReference.php, line 63

Class

EntityReference
A field formatter to display a table.

Namespace

Drupal\reference_table_formatter\Plugin\Field\FieldFormatter

Code

public function getTargetEntityId(FieldDefinitionInterface $field_definition) {
  return $field_definition
    ->getFieldStorageDefinition()
    ->getSetting('target_type');
}