You are here

public function GroupNodeDeriver::getDerivativeDefinitions in Group 2.0.x

.

Overrides DeriverBase::getDerivativeDefinitions

File

modules/gnode/src/Plugin/Group/Relation/GroupNodeDeriver.php, line 13

Class

GroupNodeDeriver

Namespace

Drupal\gnode\Plugin\Group\Relation

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;
}