You are here

class GroupContentMenuDeriver in Group Content Menu 8

Group menu deriver.

Hierarchy

Expanded class hierarchy of GroupContentMenuDeriver

File

src/Plugin/GroupContentEnabler/GroupContentMenuDeriver.php, line 12

Namespace

Drupal\group_content_menu\Plugin\GroupContentEnabler
View source
class GroupContentMenuDeriver extends DeriverBase {
  use StringTranslationTrait;

  /**
   * {@inheritdoc}
   */
  public function getDerivativeDefinitions($base_plugin_definition) {
    foreach (GroupContentMenuType::loadMultiple() as $name => $group_menu_type) {
      $label = $group_menu_type
        ->label();
      $this->derivatives[$name] = [
        'entity_bundle' => $name,
        'label' => $this
          ->t('Group menu (@type)', [
          '@type' => $label,
        ]),
        'description' => $this
          ->t('Adds %type menu items to groups.', [
          '%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
GroupContentMenuDeriver::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverBase::getDerivativeDefinitions
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.