Implements DerivativeInterface::getDerivativeDefinitions().
Overrides DerivativeInterface::getDerivativeDefinitions
public function getDerivativeDefinitions(array $base_plugin_definition) {
$supported_entities = array(
'comment',
'file',
'node',
'taxonomy_term',
'user',
);
foreach (entity_get_info() as $entity_type => $info) {
if (!in_array($entity_type, $supported_entities)) {
$this->derivatives[$entity_type] = $base_plugin_definition;
$this->derivatives[$entity_type]['label'] = t('@enitty_type selection', array(
'@entity_type' => $info['label'],
));
}
}
return $this->derivatives;
}