You are here

public function TMGMTLocalTask::setStatus in Translation Management Tool 7

Updates the status of the task.

Parameters

$status: The new status of the task. Has to be one of the task status constants.

$message: (Optional) The log message to be saved along with the status change.

$variables: (Optional) An array of variables to replace in the message on display.

Return value

int The updated status of the task if it could be set.

See also

TMGMTJob::addMessage()

File

translators/tmgmt_local/entity/tmgmt_local.entity.task.inc, line 226

Class

TMGMTLocalTask
Entity class for the local task entity.

Code

public function setStatus($status) {

  // Return TRUE if the status could be set. Return FALSE otherwise.
  if (array_key_exists($status, tmgmt_local_task_statuses())) {
    $this
      ->incrementLoopCount($status, $this->tuid);
    $this->status = $status;
    $this
      ->save();
  }
  return $this->status;
}