You are here

public function GroupMediaDeriver::getDerivativeDefinitions in Group Media 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/GroupContentEnabler/GroupMediaDeriver.php \Drupal\groupmedia\Plugin\GroupContentEnabler\GroupMediaDeriver::getDerivativeDefinitions()

.

Overrides DeriverBase::getDerivativeDefinitions

File

src/Plugin/GroupContentEnabler/GroupMediaDeriver.php, line 13

Class

GroupMediaDeriver

Namespace

Drupal\groupmedia\Plugin\GroupContentEnabler

Code

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