You are here

public function BulkForm::init in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/field/BulkForm.php \Drupal\views\Plugin\views\field\BulkForm::init()
  2. 9 core/modules/views/src/Plugin/views/field/BulkForm.php \Drupal\views\Plugin\views\field\BulkForm::init()

File

core/modules/views/src/Plugin/views/field/BulkForm.php, line 123

Class

BulkForm
Defines an actions-based bulk operation form element.

Namespace

Drupal\views\Plugin\views\field

Code

public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
  parent::init($view, $display, $options);
  $entity_type = $this
    ->getEntityType();

  // Filter the actions to only include those for this entity type.
  $this->actions = array_filter($this->actionStorage
    ->loadMultiple(), function ($action) use ($entity_type) {
    return $action
      ->getType() == $entity_type;
  });
}