You are here

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

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

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;
}