function ActionListBuilder::__construct

Same name in other branches
  1. 9 core/modules/action/src/ActionListBuilder.php \Drupal\action\ActionListBuilder::__construct()
  2. 8.9.x core/modules/action/src/ActionListBuilder.php \Drupal\action\ActionListBuilder::__construct()
  3. 11.x core/modules/action/src/ActionListBuilder.php \Drupal\action\ActionListBuilder::__construct()

Constructs a new ActionListBuilder object.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type definition.

\Drupal\Core\Entity\EntityStorageInterface $storage: The action storage.

\Drupal\Core\Action\ActionManager $action_manager: The action plugin manager.

\Drupal\Core\Form\FormBuilderInterface $formBuilder: The form builder.

Overrides EntityListBuilder::__construct

File

core/modules/action/src/ActionListBuilder.php, line 46

Class

ActionListBuilder
Defines a class to build a listing of action entities.

Namespace

Drupal\action

Code

public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, ActionManager $action_manager, ?FormBuilderInterface $formBuilder = NULL) {
    parent::__construct($entity_type, $storage);
    $this->actionManager = $action_manager;
    if (!$formBuilder) {
        @trigger_error('Calling ' . __METHOD__ . ' without the $formBuilder argument is deprecated in drupal:10.3.0 and it will be required in drupal:11.0.0. See https://www.drupal.org/node/3159776', E_USER_DEPRECATED);
        $this->formBuilder = \Drupal::service('form_builder');
    }
}

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