You are here

class GroupNodeDeriver in Group 8

Hierarchy

Expanded class hierarchy of GroupNodeDeriver

File

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

Namespace

Drupal\gnode\Plugin\GroupContentEnabler
View source
class GroupNodeDeriver extends DeriverBase {

  /**
   * {@inheritdoc}.
   */
  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;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DeriverBase::$derivatives protected property List of derivative definitions. 1
DeriverBase::getDerivativeDefinition public function Gets the definition of a derivative plugin. Overrides DeriverInterface::getDerivativeDefinition
GroupNodeDeriver::getDerivativeDefinitions public function . Overrides DeriverBase::getDerivativeDefinitions