You are here

public static function MaestroEngine::getAllEntityIdentifiersForProcess in Maestro 8.2

Same name and namespace in other branches
  1. 3.x src/Engine/MaestroEngine.php \Drupal\maestro\Engine\MaestroEngine::getAllEntityIdentifiersForProcess()

Fetches all of the the entity identifiers in the maestro_entity_identifiers entity for the process.

Parameters

int $processID: The Maestro Process ID.

Return value

array An array of arrays keyed by the task's unique identifier for the entity. Empty array if nothing found.

File

src/Engine/MaestroEngine.php, line 1082

Class

MaestroEngine
Class MaestroEngine.

Namespace

Drupal\maestro\Engine

Code

public static function getAllEntityIdentifiersForProcess($processID) {
  $retArray = [];
  $query = \Drupal::entityQuery('maestro_entity_identifiers')
    ->condition('process_id', $processID);
  $entityIDs = $query
    ->execute();
  foreach ($entityIDs as $entityID) {
    $record = \Drupal::entityTypeManager()
      ->getStorage('maestro_entity_identifiers')
      ->load($entityID);
    if ($record) {
      $retArray[$record->unique_id
        ->getString()] = [
        'unique_id' => $record->unique_id
          ->getString(),
        'entity_type' => $record->entity_type
          ->getString(),
        'bundle' => $record->bundle
          ->getString(),
        'entity_id' => $record->entity_id
          ->getString(),
      ];
    }
  }
  return $retArray;
}