protected function BaseTmgmtActionApproveForm::getEntities in TMGMT Extension Suite 8.2
Same name and namespace in other branches
- 8.3 src/Form/BaseTmgmtActionApproveForm.php \Drupal\tmgmt_extension_suit\Form\BaseTmgmtActionApproveForm::getEntities()
- 8 src/Form/BaseTmgmtActionApproveForm.php \Drupal\tmgmt_extension_suit\Form\BaseTmgmtActionApproveForm::getEntities()
2 calls to BaseTmgmtActionApproveForm::getEntities()
- BaseTmgmtActionApproveForm::buildForm in src/
Form/ BaseTmgmtActionApproveForm.php - Form constructor.
- RequestTranslationTmgmtActionApproveForm::submitForm in src/
Form/ RequestTranslationTmgmtActionApproveForm.php - Form submission handler.
File
- src/
Form/ BaseTmgmtActionApproveForm.php, line 121
Class
- BaseTmgmtActionApproveForm
- Provides a confirmation form for sending multiple content entities.
Namespace
Drupal\tmgmt_extension_suit\FormCode
protected function getEntities(array $entity_ids) {
$entities = [];
$number_of_entity_types = count(array_unique(array_values($entity_ids)));
if ($number_of_entity_types == 1) {
$entity_type = array_values($entity_ids)[0];
$ids = array_keys($entity_ids);
/** @var \Drupal\node\NodeInterface[] $nodes */
$entities = $this->entityTypeManager
->getStorage($entity_type)
->loadMultiple($ids);
}
else {
foreach ($entity_ids as $id => $ent_type) {
$entities[] = $this->entityTypeManager
->getStorage($ent_type)
->load($id);
}
}
return $entities;
}