class CommerceAutoSkuConfigTask in Commerce AutoSKU 8.2
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\commerce_autosku\Plugin\Derivative\CommerceAutoSkuConfigTask implements ContainerDeriverInterface
Expanded class hierarchy of CommerceAutoSkuConfigTask
1 string reference to 'CommerceAutoSkuConfigTask'
File
- src/
Plugin/ Derivative/ CommerceAutoSkuConfigTask.php, line 10
Namespace
Drupal\commerce_autosku\Plugin\DerivativeView source
class CommerceAutoSkuConfigTask extends DeriverBase implements ContainerDeriverInterface {
/**
* The entity manager
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityManager;
/**
* Creates an FieldUiLocalTask object.
*
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_manager
* The entity manager.
*/
public function __construct(EntityTypeManagerInterface $entity_manager) {
$this->entityManager = $entity_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) {
$this->derivatives = array();
foreach ($this->entityManager
->getDefinitions() as $entity_type_id => $entity_type) {
if (!$entity_type
->hasLinkTemplate('auto-sku')) {
continue;
}
$this->derivatives["{$entity_type_id}.auto_sku_tab"] = array(
'route_name' => "entity.{$entity_type_id}.auto_sku",
'title' => 'Automatic SKU',
'base_route' => "entity.{$entity_type_id}.edit_form",
'weight' => 100,
);
}
foreach ($this->derivatives as &$entry) {
$entry += $base_plugin_definition;
}
return $this->derivatives;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CommerceAutoSkuConfigTask:: |
protected | property | The entity manager | |
CommerceAutoSkuConfigTask:: |
public static | function |
Creates a new class instance. Overrides ContainerDeriverInterface:: |
|
CommerceAutoSkuConfigTask:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |
|
CommerceAutoSkuConfigTask:: |
public | function | Creates an FieldUiLocalTask object. | |
DeriverBase:: |
protected | property | List of derivative definitions. | 1 |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |