You are here

public static function MaestroEngine::getAllEntityIdentifiersForProcess in Maestro 3.x

Same name and namespace in other branches
  1. 8.2 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.

1 call to MaestroEngine::getAllEntityIdentifiersForProcess()
MaestroTrace::buildForm in src/Form/MaestroTrace.php
This is the trace form. Quite complex.

File

src/Engine/MaestroEngine.php, line 1088

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)
    ->accessCheck(FALSE);
  $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;
}