DerivedAccessControlPlugins.php in Workbench Access 8
File
tests/modules/workbench_access_test/src/Plugin/Derivative/DerivedAccessControlPlugins.php
View source
<?php
namespace Drupal\workbench_access_test\Plugin\Derivative;
use Drupal\Component\Plugin\Derivative\DeriverBase;
class DerivedAccessControlPlugins extends DeriverBase {
public function getDerivativeDefinitions($base_plugin_definition) {
$this->derivatives = [];
foreach ([
'foo',
'bar',
] as $plugin_id) {
$this->derivatives[$plugin_id] = [
'label' => sprintf('Plugin for %s', $plugin_id),
] + $base_plugin_definition;
}
return $this->derivatives;
}
}