class SubgroupDeriver in Subgroup (Graph) 1.0.x
Derives subgroup plugin definitions based on group types types.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\ggroup\Plugin\GroupContentEnabler\SubgroupDeriver
Expanded class hierarchy of SubgroupDeriver
See also
\Drupal\ggroup\Plugin\GroupContentEnabler\Subgroup;
File
- src/
Plugin/ GroupContentEnabler/ SubgroupDeriver.php, line 13
Namespace
Drupal\ggroup\Plugin\GroupContentEnablerView source
class SubgroupDeriver extends DeriverBase {
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
foreach (GroupType::loadMultiple() as $name => $group_type) {
$label = $group_type
->label();
$this->derivatives[$name] = [
'entity_bundle' => $name,
'label' => t('Subgroup (@type)', [
'@type' => $label,
]),
'description' => t('Adds %type groups to groups both publicly and privately.', [
'%type' => $label,
]),
] + $base_plugin_definition;
}
return $this->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:: |
|
SubgroupDeriver:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |