You are here

public function SetUnitState::executeMultiple in Booking and Availability Management Tools for Drupal 8

Executes the plugin for an array of objects.

Parameters

array $objects: An array of entities.

Overrides ActionBase::executeMultiple

1 call to SetUnitState::executeMultiple()
SetUnitState::execute in modules/bat_unit/src/Plugin/Action/SetUnitState.php
Executes the plugin.

File

modules/bat_unit/src/Plugin/Action/SetUnitState.php, line 79
Contains \Drupal\bat_unit\Plugin\Action\SetUnitState.

Class

SetUnitState
Assign fixed-state event to units.

Namespace

Drupal\bat_unit\Plugin\Action

Code

public function executeMultiple(array $entities) {
  $info = [];
  foreach ($entities as $unit) {
    $langcode = $unit
      ->language()
      ->getId();
    $info[$unit
      ->id()][$langcode] = $langcode;
  }
  $this->tempStore
    ->set($this->currentUser
    ->id(), $info);
}