You are here

public static function MaestroEngine::getTaskStatusLabel in Maestro 8.2

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

Fetches a translatable label for task status.

Please see maestro.module for TASK_STATUS defines.

Parameters

int $status: The task's status integer value.

File

src/Engine/MaestroEngine.php, line 762

Class

MaestroEngine
Class MaestroEngine.

Namespace

Drupal\maestro\Engine

Code

public static function getTaskStatusLabel($status) {
  $return_status = '';
  switch ($status) {
    case TASK_STATUS_ACTIVE:
      $return_status = t('Active');
      break;
    case TASK_STATUS_ABORTED:
      $return_status = t('Aborted');
      break;
    case TASK_STATUS_CANCEL:
      $return_status = t('Cancelled');
      break;
    case TASK_STATUS_HOLD:
      $return_status = t('On Hold');
      break;
    case TASK_STATUS_SUCCESS:
      $return_status = t('Successfully Completed');
      break;
    default:
      $return_status = t('Unknown');
      break;
  }
  return $return_status;
}