Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Action/ActionManager.php \Drupal\Core\Action\ActionManager
  2. 9 core/lib/Drupal/Core/Action/ActionManager.php \Drupal\Core\Action\ActionManager

Provides an Action plugin manager.

Hierarchy

Expanded class hierarchy of ActionManager

See also

\Drupal\Core\Annotation\Action

\Drupal\Core\Action\ActionInterface

\Drupal\Core\Action\ActionBase

Plugin API

1 file declares its use of ActionManager
ActionAdminManageForm.php in core/modules/action/src/Form/ActionAdminManageForm.php
1 string reference to 'ActionManager'
core.services.yml in core/core.services.yml
core/core.services.yml
1 service uses ActionManager
plugin.manager.action in core/core.services.yml
Drupal\Core\Action\ActionManager

File

core/lib/Drupal/Core/Action/ActionManager.php, line 20

Namespace

Drupal\Core\Action
View source
class ActionManager extends DefaultPluginManager implements CategorizingPluginManagerInterface {
  use CategorizingPluginManagerTrait;

  /**
   * Constructs a new class instance.
   *
   * @param \Traversable $namespaces
   *   An object that implements \Traversable which contains the root paths
   *   keyed by the corresponding namespace to look for plugin implementations.
   * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
   *   Cache backend instance to use.
   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
   *   The module handler to invoke the alter hook with.
   */
  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
    parent::__construct('Plugin/Action', $namespaces, $module_handler, 'Drupal\\Core\\Action\\ActionInterface', Action::class, 'Drupal\\Core\\Annotation\\Action');
    $this
      ->alterInfo('action_info');
    $this
      ->setCacheBackend($cache_backend, 'action_info');
  }

  /**
   * Gets the plugin definitions for this entity type.
   *
   * @param string $type
   *   The entity type name.
   *
   * @return array
   *   An array of plugin definitions for this entity type.
   */
  public function getDefinitionsByType($type) {
    return array_filter($this
      ->getDefinitions(), function ($definition) use ($type) {
      return $definition['type'] === $type;
    });
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ActionManager::getDefinitionsByType public function Gets the plugin definitions for this entity type.
ActionManager::__construct public function Constructs a new class instance.
CategorizingPluginManagerTrait::getCategories public function
CategorizingPluginManagerTrait::getGroupedDefinitions public function
CategorizingPluginManagerTrait::getModuleExtensionList protected function Returns the module extension list used.
CategorizingPluginManagerTrait::getModuleHandler Deprecated public function Returns the module handler used.
CategorizingPluginManagerTrait::getProviderName protected function Gets the name of a provider.
CategorizingPluginManagerTrait::getSortedDefinitions public function
CategorizingPluginManagerTrait::processDefinitionCategory protected function Processes a plugin definition to ensure there is a category.
DiscoveryInterface::getDefinition public function Gets a specific plugin definition. 2
DiscoveryInterface::getDefinitions public function Gets the definition of all plugins for this type. 3
DiscoveryInterface::hasDefinition public function Indicates if a specific plugin definition exists.
FactoryInterface::createInstance public function Creates a plugin instance based on the provided ID and configuration. 6
MapperInterface::getInstance public function Gets or creates a plugin instance that satisfies the given options. 2
StringTranslationTrait::$stringTranslation protected property The string translation service. 3
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 1
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.