Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ConfigAction.php

function ConfigAction::__construct

Constructs a ConfigAction attribute.

Parameters

string $id: The plugin ID.

\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.

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().

class-string|null $deriver: (optional) The deriver class.

Overrides Plugin::__construct

See also

\Drupal\Core\Config\Action\ConfigActionManager::convertActionToPluginId()

File

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

Class

ConfigAction
Defines a ConfigAction attribute object.

Namespace

Drupal\Core\Config\Action\Attribute

Code

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));
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal