You are here

public static function MaestroEngine::getAllStatusEntriesForProcess in Maestro 8.2

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

Fetches all of the the status entries for the process.

Parameters

int $processID: The Maestro Process ID.

Return value

array An array of arrays keyed by the stage number for the message. Empty array if nothing found.

1 call to MaestroEngine::getAllStatusEntriesForProcess()
MaestroStatus::getMaestroStatusBar in src/Utility/MaestroStatus.php
Generates the staus bar showing process completion as status indicators.

File

src/Engine/MaestroEngine.php, line 1111

Class

MaestroEngine
Class MaestroEngine.

Namespace

Drupal\maestro\Engine

Code

public static function getAllStatusEntriesForProcess($processID) {
  $retArray = [];
  $query = \Drupal::entityQuery('maestro_process_status')
    ->condition('process_id', $processID)
    ->sort('stage_number', 'ASC');
  $entityIDs = $query
    ->execute();
  foreach ($entityIDs as $entityID) {
    $record = \Drupal::entityTypeManager()
      ->getStorage('maestro_process_status')
      ->load($entityID);
    if ($record) {
      $retArray[$record->stage_number
        ->getString()] = [
        'message' => $record->stage_message
          ->getString(),
        'completed' => $record->completed
          ->getString(),
        'stage_number' => $record->stage_number
          ->getString(),
      ];
    }
  }
  return $retArray;
}