function EntityMethod::create

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Config/Action/Plugin/ConfigAction/EntityMethod.php \Drupal\Core\Config\Action\Plugin\ConfigAction\EntityMethod::create()

Overrides ContainerFactoryPluginInterface::create

File

core/lib/Drupal/Core/Config/Action/Plugin/ConfigAction/EntityMethod.php, line 77

Class

EntityMethod
Makes config entity methods with the ActionMethod attribute into actions.

Namespace

Drupal\Core\Config\Action\Plugin\ConfigAction

Code

public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) : static {
    assert(is_array($plugin_definition) && is_array($plugin_definition['constructor_args']), '$plugin_definition contains the expected settings');
    return new static($plugin_id, $container->get('config.manager'), ...$plugin_definition['constructor_args']);
}

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