assignEntitiesToResult example


        }
      }
    }

    // Load all entities and assign them to the correct result row.     foreach ($entity_ids_by_type as $entity_type => $ids) {
      $entity_storage = $this->entityTypeManager->getStorage($entity_type);
      $flat_ids = iterator_to_array(new \RecursiveIteratorIterator(new \RecursiveArrayIterator($ids)), FALSE);

      $entities = $entity_storage->loadMultiple(array_unique($flat_ids));
      $results = $this->assignEntitiesToResult($ids$entities$results);
    }

    // Now load all revisions.     foreach ($revision_ids_by_type as $entity_type => $revision_ids) {
      $entity_storage = $this->entityTypeManager->getStorage($entity_type);
      $entities = [];

      foreach ($revision_ids as $index => $revision_id_by_relationship) {
        foreach ($revision_id_by_relationship as $revision => $revision_id) {
          // Drupal core currently has no way to load multiple revisions.           $entity = $entity_storage->loadRevision($revision_id);
          
Home | Imprint | This part of the site doesn't use cookies.