Redirects to a node deletion form.
@Action(
id = "node_delete_action",
label = @Translation("Delete selected content"),
type = "node",
confirm_form_path = "admin/content/node/delete"
)
Expanded class hierarchy of DeleteNode
class DeleteNode extends ActionBase {
/**
* The tempstore object.
*
* @var \Drupal\user\TempStore
*/
protected $tempStore;
/**
* Constructs a new DeleteNode object.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin ID for the plugin instance.
* @param array $plugin_definition
* The plugin implementation definition.
* @param \Drupal\user\TempStoreFactory $temp_store_factory
* The tempstore factory.
*/
public function __construct(array $configuration, $plugin_id, array $plugin_definition, TempStoreFactory $temp_store_factory) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->tempStore = $temp_store_factory
->get('node_multiple_delete_confirm');
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, array $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('user.tempstore'));
}
/**
* {@inheritdoc}
*/
public function executeMultiple(array $entities) {
$this->tempStore
->set($GLOBALS['user']->uid, $entities);
}
/**
* {@inheritdoc}
*/
public function execute($object = NULL) {
$this
->executeMultiple(array(
$object,
));
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeleteNode:: |
protected | property | The tempstore object. | |
DeleteNode:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginBase:: |
|
DeleteNode:: |
public | function |
Executes the plugin. Overrides ExecutableInterface:: |
|
DeleteNode:: |
public | function |
Executes the plugin for an array of objects. Overrides ActionBase:: |
|
DeleteNode:: |
public | function |
Constructs a new DeleteNode object. Overrides PluginBase:: |
|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
public | function |
Returns the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function |
Returns the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |