class EntityFlagTypeDeriver in Flag 8.4
Derivative class for entity flag type plugin.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\flag\Plugin\Derivative\EntityFlagTypeDeriver
Expanded class hierarchy of EntityFlagTypeDeriver
File
- src/
Plugin/ Derivative/ EntityFlagTypeDeriver.php, line 11
Namespace
Drupal\flag\Plugin\DerivativeView source
class EntityFlagTypeDeriver extends DeriverBase {
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_def) {
$derivatives = [];
foreach (\Drupal::entityTypeManager()
->getDefinitions() as $entity_id => $entity_type) {
// Skip config entity types.
if (!$entity_type instanceof ContentEntityTypeInterface) {
continue;
}
$derivatives[$entity_id] = [
'title' => $entity_type
->getLabel(),
'entity_type' => $entity_id,
'config_dependencies' => [
'module' => [
$entity_type
->getProvider(),
],
],
] + $base_plugin_def;
}
return $derivatives;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeriverBase:: |
protected | property | List of derivative definitions. | 1 |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
EntityFlagTypeDeriver:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |