You are here

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

Same name and namespace in other branches
  1. 8.2 src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::getFilteredEntities()
  2. 4.0.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::getFilteredEntities()
  3. 3.0.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::getFilteredEntities()
  4. 3.1.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::getFilteredEntities()
  5. 3.2.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::getFilteredEntities()
  6. 3.3.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::getFilteredEntities()
  7. 3.5.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::getFilteredEntities()
  8. 3.6.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::getFilteredEntities()
  9. 3.7.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::getFilteredEntities()
  10. 3.8.x src/Form/LingotekManagementRelatedEntitiesForm.php \Drupal\lingotek\Form\LingotekManagementRelatedEntitiesForm::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/LingotekManagementRelatedEntitiesForm.php, line 200

Class

LingotekManagementRelatedEntitiesForm
Form for bulk management of related content.

Namespace

Drupal\lingotek\Form

Code

protected function getFilteredEntities() {
  $entities = [];
  $related = [];
  $visited = [];
  $recursion_depth = $this
    ->getRecursionDepth();
  $type = \Drupal::service('plugin.manager.related_entities_detector');
  $plugin_definitions = $type
    ->getDefinitions();
  uasort($plugin_definitions, 'Drupal\\Component\\Utility\\SortArray::sortByWeightElement');
  foreach ($plugin_definitions as $plugin_definition_id => $plugin_definition) {

    /** @var \Drupal\lingotek\RelatedEntities\RelatedEntitiesDetectorInterface $plugin */
    $plugin = $type
      ->createInstance($plugin_definition_id, []);
    $entities = $plugin
      ->extract($this->node, $entities, $related, $recursion_depth, $visited);
  }
  $this->related = $related;
  return $entities;
}