本文整理汇总了PHP中Task::getStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP Task::getStatus方法的具体用法?PHP Task::getStatus怎么用?PHP Task::getStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task::getStatus方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Event
$modified = true;
}
// is description modified?
if ($description != $task->getDescription()) {
// save changes
$oldDescription = $task->getDescription();
$task->setDescription($description);
$task->save();
// log it
$logEvent = new Event(array('event_type_id' => 'edit_task_description', 'project_id' => $project->getID(), 'user_1_id' => Session::getUserID(), 'item_1_id' => $task->getID(), 'data_1' => $oldDescription, 'data_2' => $description));
$logEvent->save();
// set flag
$modified = true;
}
// is status modified?
if ($status != $task->getStatus()) {
// save changes
$oldStatus = $task->getStatus();
$task->setStatus($status);
$task->save();
// log it
$logEvent = new Event(array('event_type_id' => 'edit_task_status', 'project_id' => $project->getID(), 'user_1_id' => Session::getUserID(), 'item_1_id' => $task->getID(), 'data_1' => $oldStatus, 'data_2' => $status));
$logEvent->save();
// set flag
$modified = true;
}
// is num needed modified?
if ($numNeeded != $task->getNumNeeded()) {
// save changes
$oldNumNeeded = $task->getNumNeeded();
$task->setNumNeeded($numNeeded);
示例2: foreach
if (isset($archive_lane->ReplyData)) {
foreach ($archive_lane->ReplyData as $lane_archive) {
foreach ($lane_archive as $archive) {
foreach ($archive->Lane->Cards as $card) {
if (!in_array($card->ExternalCardID, $external_task_id)) {
array_push($external_task_id, $card->ExternalCardID);
if ($card->ExternalCardID) {
//getting the idtask from project_task table by sending idproject_task(ExternalCardID)
$do_project_task = new ProjectTask();
$idtask = $do_project_task->getTaskId($card->ExternalCardID);
$do_project_task->free();
echo '<br>' . $card->ExternalCardID;
//Close the task (update the status to 'closed')
if ($idtask) {
$do_task = new Task();
$status = $do_task->getStatus($idtask);
echo $status . ":";
if ($status != 'closed') {
$do_task->updateStatus($idtask, "closed");
}
$do_task->free();
}
}
}
}
}
}
}
// }//added for testing
}
}
示例3: saveTask
/**
* Save or update task
* @param Task $task
* @return Task
*/
public function saveTask(Task $task)
{
if (is_null($task->getId())) {
$query = $this->db->prepare("INSERT INTO tasks (name, parameters, status) VALUES (?, ?, ?)");
$query->execute([$task->getName(), $task->getParameters(), $task->getStatus()]);
$task->setId($this->db->lastInsertId());
} else {
$query = $this->db->prepare("UPDATE tasks SET name = ?, parameters = ?, status = ? WHERE id = ?");
$query->execute([$task->getName(), $task->getParameters(), $task->getStatus(), $task->getId()]);
}
return $task;
}
示例4: run
/**
* Run the task.
*
* @param string $logfile The log file to use.
*
* @return bool
*/
public function run($logfile)
{
$this->task->perform($logfile);
return Task::STATE_FINISHED === $this->task->getStatus();
}