You are here

public function TcaPluginBase::getEntityTokenMap in Token Content Access 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/TcaPluginBase.php \Drupal\tca\Plugin\TcaPluginBase::getEntityTokenMap()

Return a map of entity IDs used by this plugin to token IDs.

Return value

array A map of token IDs to entity IDs in the form ['entity ID' => 'token ID']

Overrides TcaPluginInterface::getEntityTokenMap

File

src/Plugin/TcaPluginBase.php, line 36

Class

TcaPluginBase
Base class for TCA plugins.

Namespace

Drupal\tca\Plugin

Code

public function getEntityTokenMap() {
  $map = [];
  $map[$this->pluginDefinition['entityType']] = $this->pluginDefinition['entityType'];
  $bundle = \Drupal::entityTypeManager()
    ->getDefinition($this->pluginDefinition['entityType'])
    ->getBundleEntityType();
  if (!empty($bundle)) {
    $map[$bundle] = $bundle;
  }
  return $map;
}