You are here

public function BaseJobAction::executeMultiple in TMGMT Extension Suite 8.2

Same name and namespace in other branches
  1. 8.3 src/Plugin/Action/BaseJobAction.php \Drupal\tmgmt_extension_suit\Plugin\Action\BaseJobAction::executeMultiple()
  2. 8 src/Plugin/Action/BaseJobAction.php \Drupal\tmgmt_extension_suit\Plugin\Action\BaseJobAction::executeMultiple()

Executes the plugin for an array of objects.

Parameters

array $objects: An array of entities.

Overrides ActionBase::executeMultiple

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

File

src/Plugin/Action/BaseJobAction.php, line 85

Class

BaseJobAction

Namespace

Drupal\tmgmt_extension_suit\Plugin\Action

Code

public function executeMultiple(array $entities) {
  $ids = [];

  /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
  foreach ($entities as $entity) {
    $ids[$entity
      ->id()] = $entity
      ->getEntityTypeId();
  }
  $entity = reset($entities);
  if ($entity instanceof EntityInterface) {
    $entity_type = $entity
      ->getEntityTypeId();
  }
  $this->tempStoreFactory
    ->get($this
    ->getTempStoreName($entity_type))
    ->set($this->currentUser
    ->id(), $ids);
}