You are here

public function GroupNodeDeriver::getDerivativeDefinitions in Group 8

.

Overrides DeriverBase::getDerivativeDefinitions

File

modules/gnode/src/Plugin/GroupContentEnabler/GroupNodeDeriver.php, line 13

Class

GroupNodeDeriver

Namespace

Drupal\gnode\Plugin\GroupContentEnabler

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  $this->derivatives = [];
  foreach (NodeType::loadMultiple() as $name => $node_type) {
    $label = $node_type
      ->label();
    $this->derivatives[$name] = [
      'entity_bundle' => $name,
      'label' => t('Group node (@type)', [
        '@type' => $label,
      ]),
      'description' => t('Adds %type content to groups both publicly and privately.', [
        '%type' => $label,
      ]),
    ] + $base_plugin_definition;
  }
  return $this->derivatives;
}