You are here

protected function LingotekJobManagementContentEntitiesForm::getFilteredEntities in Lingotek Translation 3.4.x

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

Gets the entities that needs to be displayed based on the current filters.

Return value

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

Overrides LingotekManagementFormBase::getFilteredEntities

File

src/Form/LingotekJobManagementContentEntitiesForm.php, line 105

Class

LingotekJobManagementContentEntitiesForm
Form for bulk management of job filtered content.

Namespace

Drupal\lingotek\Form

Code

protected function getFilteredEntities() {
  $entity_query = $this->entityTypeManager
    ->getStorage('lingotek_content_metadata')
    ->getQuery();
  $entity_query
    ->condition('job_id', $this->jobId);
  $ids = $entity_query
    ->execute();
  $metadatas = $this->entityTypeManager
    ->getStorage('lingotek_content_metadata')
    ->loadMultiple($ids);
  $entities = [];

  /** @var \Drupal\lingotek\Entity\LingotekContentMetadata $metadata */
  foreach ($metadatas as $metadata) {
    $content_entity_type_id = $metadata
      ->getContentEntityTypeId();
    $content_entity_id = $metadata
      ->getContentEntityId();
    $entity = $this->entityTypeManager
      ->getStorage($content_entity_type_id)
      ->load($content_entity_id);
    $entities[$content_entity_type_id][] = $entity;
  }
  return $entities;
}