public function RabbitHoleEntityPluginBase::getEntityTokenMap in Rabbit Hole 2.x
Same name and namespace in other branches
- 8 src/Plugin/RabbitHoleEntityPluginBase.php \Drupal\rabbit_hole\Plugin\RabbitHoleEntityPluginBase::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 RabbitHoleEntityPluginInterface::getEntityTokenMap
1 method overrides RabbitHoleEntityPluginBase::getEntityTokenMap()
- Taxonomy::getEntityTokenMap in modules/
rh_taxonomy/ src/ Plugin/ RabbitHoleEntityPlugin/ Taxonomy.php - Return a map of entity IDs used by this plugin to token IDs.
File
- src/
Plugin/ RabbitHoleEntityPluginBase.php, line 44
Class
- RabbitHoleEntityPluginBase
- Base class for Rabbit hole entity plugin plugins.
Namespace
Drupal\rabbit_hole\PluginCode
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;
}