class MergeLocalTask in Bibliography & Citation 8
Same name and namespace in other branches
- 2.0.x modules/bibcite_entity/src/Plugin/Derivative/MergeLocalTask.php \Drupal\bibcite_entity\Plugin\Derivative\MergeLocalTask
Provides dynamic tabs based on available formats.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\bibcite_entity\Plugin\Derivative\MergeLocalTask implements ContainerDeriverInterface
Expanded class hierarchy of MergeLocalTask
1 string reference to 'MergeLocalTask'
- bibcite_entity.links.task.yml in modules/
bibcite_entity/ bibcite_entity.links.task.yml - modules/bibcite_entity/bibcite_entity.links.task.yml
File
- modules/
bibcite_entity/ src/ Plugin/ Derivative/ MergeLocalTask.php, line 13
Namespace
Drupal\bibcite_entity\Plugin\DerivativeView source
class MergeLocalTask extends DeriverBase implements ContainerDeriverInterface {
/**
* The entity type manager.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* Constructs a new DynamicLocalTasks.
*
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
*/
public function __construct(EntityTypeManagerInterface $entity_type_manager) {
$this->entityTypeManager = $entity_type_manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, $base_plugin_id) {
return new static($container
->get('entity_type.manager'));
}
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
/* @var \Drupal\Core\Entity\EntityTypeInterface $entity_type */
foreach ($this->entityTypeManager
->getDefinitions() as $entity_type_id => $entity_type) {
if ($entity_type
->hasLinkTemplate('bibcite-merge-form')) {
$this->derivatives["entity.{$entity_type_id}.bibcite_merge_form"] = [
'route_name' => "entity.{$entity_type_id}.bibcite_merge_form",
'base_route' => "entity.{$entity_type_id}.canonical",
] + $base_plugin_definition;
}
}
return $this->derivatives;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeriverBase:: |
protected | property | List of derivative definitions. | 1 |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
MergeLocalTask:: |
protected | property | The entity type manager. | |
MergeLocalTask:: |
public static | function |
Creates a new class instance. Overrides ContainerDeriverInterface:: |
|
MergeLocalTask:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |
|
MergeLocalTask:: |
public | function | Constructs a new DynamicLocalTasks. |