class Action

Same name in this branch
  1. 11.x core/modules/system/src/Entity/Action.php \Drupal\system\Entity\Action
  2. 11.x core/modules/system/src/Plugin/migrate/source/Action.php \Drupal\system\Plugin\migrate\source\Action
  3. 11.x core/lib/Drupal/Core/Annotation/Action.php \Drupal\Core\Annotation\Action
Same name and namespace in other branches
  1. 9 core/modules/action/src/Plugin/migrate/source/Action.php \Drupal\action\Plugin\migrate\source\Action
  2. 9 core/modules/system/src/Entity/Action.php \Drupal\system\Entity\Action
  3. 9 core/modules/system/src/Plugin/migrate/source/Action.php \Drupal\system\Plugin\migrate\source\Action
  4. 9 core/lib/Drupal/Core/Annotation/Action.php \Drupal\Core\Annotation\Action
  5. 8.9.x core/modules/action/src/Plugin/migrate/source/Action.php \Drupal\action\Plugin\migrate\source\Action
  6. 8.9.x core/modules/system/src/Entity/Action.php \Drupal\system\Entity\Action
  7. 8.9.x core/lib/Drupal/Core/Annotation/Action.php \Drupal\Core\Annotation\Action
  8. 10 core/modules/system/src/Entity/Action.php \Drupal\system\Entity\Action
  9. 10 core/modules/system/src/Plugin/migrate/source/Action.php \Drupal\system\Plugin\migrate\source\Action
  10. 10 core/lib/Drupal/Core/Action/Attribute/Action.php \Drupal\Core\Action\Attribute\Action
  11. 10 core/lib/Drupal/Core/Annotation/Action.php \Drupal\Core\Annotation\Action

Defines an Action attribute object.

Plugin Namespace: Plugin\Action

Attributes

#[\Attribute(\Attribute::TARGET_CLASS)]

Hierarchy

Expanded class hierarchy of Action

See also

\Drupal\Core\Action\ActionInterface

\Drupal\Core\Action\ActionManager

\Drupal\Core\Action\ActionBase

\Drupal\Core\Action\Plugin\Action\UnpublishAction

Plugin API

21 files declare their use of Action
ActionManager.php in core/lib/Drupal/Core/Action/ActionManager.php
AddRoleUser.php in core/modules/user/src/Plugin/Action/AddRoleUser.php
BatchUserAction.php in core/modules/views/tests/modules/user_batch_action_test/src/Plugin/Action/BatchUserAction.php
BlockUser.php in core/modules/user/src/Plugin/Action/BlockUser.php
CancelUser.php in core/modules/user/src/Plugin/Action/CancelUser.php

... See full list

26 string references to 'Action'
BulkForm::defineOptions in core/modules/views/src/Plugin/views/field/BulkForm.php
Information about options for all kinds of purposes will be held here.
BulkForm::viewsFormValidate in core/modules/views/src/Plugin/views/field/BulkForm.php
BulkForm::__construct in core/modules/views/src/Plugin/views/field/BulkForm.php
Constructs a new BulkForm object.
BulkFormTest::testBulkForm in core/modules/views/tests/src/Functional/BulkFormTest.php
Tests the bulk form.
BulkFormTest::testConfirmRouteWithParameters in core/modules/views/tests/src/Functional/BulkFormTest.php
Tests that route parameters are passed to the confirmation form route.

... See full list

File

core/lib/Drupal/Core/Action/Attribute/Action.php, line 19

Namespace

Drupal\Core\Action\Attribute
View source
class Action extends Plugin {
  
  /**
   * Constructs an Action attribute.
   *
   * @param string $id
   *   The plugin ID.
   * @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $label
   *   The label of the action.
   * @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $action_label
   *   (optional) A label that can be used by the action deriver.
   * @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $category
   *   (optional) The category under which the action should be listed in the
   *   UI.
   * @param class-string|null $deriver
   *   (optional) The deriver class.
   * @param string|null $confirm_form_route_name
   *   (optional) The route name for a confirmation form for this action.
   * @param string|null $type
   *   (optional) The entity type the action can apply to.
   */
  public function __construct(public readonly string $id, public readonly ?TranslatableMarkup $label = NULL, public readonly ?TranslatableMarkup $action_label = NULL, public readonly ?TranslatableMarkup $category = NULL, public readonly ?string $deriver = NULL, public readonly ?string $confirm_form_route_name = NULL, public readonly ?string $type = NULL) {
  }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
Action::__construct public function Constructs an Action attribute. Overrides Plugin::__construct
AttributeBase::$class protected property The class used for this attribute class.
AttributeBase::$provider protected property The provider of the attribute class.
AttributeBase::get public function Gets the value of an attribute. Overrides AttributeInterface::get 7
AttributeBase::getClass public function Gets the class of the attribute class. Overrides AttributeInterface::getClass 1
AttributeBase::getId public function Gets the unique ID for this attribute class. Overrides AttributeInterface::getId
AttributeBase::getProvider public function Gets the name of the provider of the attribute class. Overrides AttributeInterface::getProvider
AttributeBase::setClass public function Sets the class of the attributed class. Overrides AttributeInterface::setClass 1
AttributeBase::setProvider public function Sets the name of the provider of the attribute class. Overrides AttributeInterface::setProvider 1

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.