You are here

protected function LingotekJobManagementContentEntitiesForm::getSelectedEntities in Lingotek Translation 3.3.x

Same name and namespace in other branches
  1. 8.2 src/Form/LingotekJobManagementContentEntitiesForm.php \Drupal\lingotek\Form\LingotekJobManagementContentEntitiesForm::getSelectedEntities()
  2. 4.0.x src/Form/LingotekJobManagementContentEntitiesForm.php \Drupal\lingotek\Form\LingotekJobManagementContentEntitiesForm::getSelectedEntities()
  3. 3.0.x src/Form/LingotekJobManagementContentEntitiesForm.php \Drupal\lingotek\Form\LingotekJobManagementContentEntitiesForm::getSelectedEntities()
  4. 3.1.x src/Form/LingotekJobManagementContentEntitiesForm.php \Drupal\lingotek\Form\LingotekJobManagementContentEntitiesForm::getSelectedEntities()
  5. 3.2.x src/Form/LingotekJobManagementContentEntitiesForm.php \Drupal\lingotek\Form\LingotekJobManagementContentEntitiesForm::getSelectedEntities()
  6. 3.4.x src/Form/LingotekJobManagementContentEntitiesForm.php \Drupal\lingotek\Form\LingotekJobManagementContentEntitiesForm::getSelectedEntities()
  7. 3.5.x src/Form/LingotekJobManagementContentEntitiesForm.php \Drupal\lingotek\Form\LingotekJobManagementContentEntitiesForm::getSelectedEntities()
  8. 3.6.x src/Form/LingotekJobManagementContentEntitiesForm.php \Drupal\lingotek\Form\LingotekJobManagementContentEntitiesForm::getSelectedEntities()
  9. 3.7.x src/Form/LingotekJobManagementContentEntitiesForm.php \Drupal\lingotek\Form\LingotekJobManagementContentEntitiesForm::getSelectedEntities()
  10. 3.8.x src/Form/LingotekJobManagementContentEntitiesForm.php \Drupal\lingotek\Form\LingotekJobManagementContentEntitiesForm::getSelectedEntities()

Load the entities corresponding with the given identifiers.

Parameters

string[] $values: Array of values that identify the selected entities.

Return value

\Drupal\Core\Entity\EntityInterface[] The entities.

Overrides LingotekManagementFormBase::getSelectedEntities

File

src/Form/LingotekJobManagementContentEntitiesForm.php, line 125

Class

LingotekJobManagementContentEntitiesForm
Form for bulk management of job filtered content.

Namespace

Drupal\lingotek\Form

Code

protected function getSelectedEntities($values) {
  $entityTypes = [];
  $entities = [];
  foreach ($values as $type_entity_id) {
    list($type, $entity_id) = explode(":", $type_entity_id);
    $entityTypes[$type][] = $entity_id;
  }
  foreach ($entityTypes as $type => $values) {
    $entities = array_merge($entities, $this->entityTypeManager
      ->getStorage($type)
      ->loadMultiple($values));
  }
  return $entities;
}