class EntityActionBase
Same name in other branches
- 9 core/lib/Drupal/Core/Action/Plugin/Action/EntityActionBase.php \Drupal\Core\Action\Plugin\Action\EntityActionBase
- 8.9.x core/lib/Drupal/Core/Action/Plugin/Action/EntityActionBase.php \Drupal\Core\Action\Plugin\Action\EntityActionBase
- 10 core/lib/Drupal/Core/Action/Plugin/Action/EntityActionBase.php \Drupal\Core\Action\Plugin\Action\EntityActionBase
Base class for entity-based actions.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
- class \Drupal\Core\Action\ActionBase extends \Drupal\Core\Plugin\PluginBase implements \Drupal\Core\Action\ActionInterface
- class \Drupal\Core\Action\Plugin\Action\EntityActionBase extends \Drupal\Core\Action\ActionBase implements \Drupal\Component\Plugin\DependentPluginInterface, \Drupal\Core\Plugin\ContainerFactoryPluginInterface
- class \Drupal\Core\Action\ActionBase extends \Drupal\Core\Plugin\PluginBase implements \Drupal\Core\Action\ActionInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
Expanded class hierarchy of EntityActionBase
File
-
core/
lib/ Drupal/ Core/ Action/ Plugin/ Action/ EntityActionBase.php, line 14
Namespace
Drupal\Core\Action\Plugin\ActionView source
abstract class EntityActionBase extends ActionBase implements DependentPluginInterface, ContainerFactoryPluginInterface {
/**
* The entity type manager.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* Constructs an EntityActionBase object.
*
* @param mixed[] $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin ID for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityTypeManager = $entity_type_manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container->get('entity_type.manager'));
}
/**
* {@inheritdoc}
*/
public function calculateDependencies() {
$module_name = $this->entityTypeManager
->getDefinition($this->getPluginDefinition()['type'])
->getProvider();
return [
'module' => [
$module_name,
],
];
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
ActionBase::executeMultiple | public | function | Overrides ActionInterface::executeMultiple | 3 | |
ActionInterface::access | public | function | Checks object access. | 20 | |
EntityActionBase::$entityTypeManager | protected | property | The entity type manager. | ||
EntityActionBase::calculateDependencies | public | function | Overrides DependentPluginInterface::calculateDependencies | ||
EntityActionBase::create | public static | function | Overrides ContainerFactoryPluginInterface::create | 4 | |
EntityActionBase::__construct | public | function | Constructs an EntityActionBase object. | 4 | |
ExecutableInterface::execute | public | function | Executes the plugin. | 22 | |
PluginInspectionInterface::getPluginDefinition | public | function | Gets the definition of the plugin implementation. | 6 | |
PluginInspectionInterface::getPluginId | public | function | Gets the plugin ID of the plugin instance. | 2 |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.