class ConfigAction

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Config/Action/Attribute/ConfigAction.php \Drupal\Core\Config\Action\Attribute\ConfigAction

Defines a ConfigAction attribute object.

Plugin Namespace: Plugin\ConfigAction

@internal This API is experimental.

Hierarchy

Expanded class hierarchy of ConfigAction

See also

\Drupal\Core\Config\Action\ConfigActionPluginInterface

\Drupal\Core\Config\Action\ConfigActionManager

Plugin API

Related topics

10 files declare their use of ConfigAction
AddItemToToolbar.php in core/modules/ckeditor5/src/Plugin/ConfigAction/AddItemToToolbar.php
AddModeration.php in core/modules/content_moderation/src/Plugin/ConfigAction/AddModeration.php
AddToAllBundles.php in core/modules/field/src/Plugin/ConfigAction/AddToAllBundles.php
ConfigActionAttributeTest.php in core/tests/Drupal/Tests/Core/Config/Action/ConfigActionAttributeTest.php
ConfigActionManager.php in core/lib/Drupal/Core/Config/Action/ConfigActionManager.php

... See full list

File

core/lib/Drupal/Core/Config/Action/Attribute/ConfigAction.php, line 25

Namespace

Drupal\Core\Config\Action\Attribute
View source
final class ConfigAction extends Plugin {
    
    /**
     * Constructs a ConfigAction attribute.
     *
     * @param string $id
     *   The plugin ID.
     * @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $admin_label
     *   The administrative label of the config action. This is optional when
     *   using a deriver, but in that case the deriver should add an admin label.
     * @param string[] $entity_types
     *   (optional) Allows action shorthand IDs for the listed config entity
     *   types. If '*' is present in the array then it can apply to all entity
     *   types. An empty array means that shorthand action IDs are not available
     *   for this plugin. See ConfigActionManager::convertActionToPluginId().
     * @param class-string|null $deriver
     *   (optional) The deriver class.
     *
     * @see \Drupal\Core\Config\Action\ConfigActionManager::convertActionToPluginId()
     */
    public function __construct(string $id, ?TranslatableMarkup $admin_label = NULL, array $entity_types = [], ?string $deriver = NULL) {
        if ($this->admin_label === NULL && $this->deriver === NULL) {
            throw new InvalidPluginDefinitionException($id, sprintf("The '%s' config action plugin must have either an admin label or a deriver", $id));
        }
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
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 6
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
ConfigAction::__construct public function Constructs a ConfigAction attribute. Overrides Plugin::__construct

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