You are here

protected function ExtraFieldTypePluginBase::getEntityTokenTypes in Entity Extra Field 8

Same name and namespace in other branches
  1. 2.0.x src/ExtraFieldTypePluginBase.php \Drupal\entity_extra_field\ExtraFieldTypePluginBase::getEntityTokenTypes()

Get entity token types.

Parameters

$entity_type_id: The entity type identifier.

$entity_bundle: The entity bundle name.

Return value

array An array of the entity token types.

Throws

\Drupal\Component\Plugin\Exception\PluginNotFoundException

2 calls to ExtraFieldTypePluginBase::getEntityTokenTypes()
ExtraFieldTokenPlugin::buildConfigurationForm in src/Plugin/ExtraFieldType/ExtraFieldTokenPlugin.php
Form constructor.
ExtraFieldViewsPlugin::buildConfigurationForm in src/Plugin/ExtraFieldType/ExtraFieldViewsPlugin.php
Form constructor.

File

src/ExtraFieldTypePluginBase.php, line 289

Class

ExtraFieldTypePluginBase
Define extra field type plugin base.

Namespace

Drupal\entity_extra_field

Code

protected function getEntityTokenTypes($entity_type_id, $entity_bundle) {
  $types = $this
    ->getEntityFieldReferenceTypes($entity_type_id, $entity_bundle);
  $types = array_values($types);
  if (!in_array($entity_type_id, $types)) {
    $types[] = $entity_type_id;
  }
  return $types;
}