本文整理匯總了PHP中Schedule::getone方法的典型用法代碼示例。如果您正苦於以下問題:PHP Schedule::getone方法的具體用法?PHP Schedule::getone怎麽用?PHP Schedule::getone使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Schedule
的用法示例。
在下文中一共展示了Schedule::getone方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: smarty_function_schedule
/**
* grab the schedule for a task in a study
*/
function smarty_function_schedule($params, &$smarty)
{
if (!Check::digits($params['study_id'])) {
return;
}
if (!Check::digits($params['task_id'])) {
return;
}
$s = new Schedule();
$smarty->assign('schedule', $s->getone(array('study_id' => $params['study_id'], 'task_id' => $params['task_id'])));
}
示例2: copytask
public function copytask()
{
try {
if (!Check::digits($_REQUEST['study_id'], $empty = false)) {
throw new Exception("bad study id!");
} else {
$study_id = $_REQUEST['study_id'];
}
if (!Check::digits($_REQUEST['task_id'])) {
throw new Exception("bad task id!");
} else {
$task_id = $_REQUEST['task_id'];
}
$t = new Task();
$s = new Schedule();
$task = $t->getone($task_id);
$sched = $s->getone(array('study_id' => $study_id, 'task_id' => $task_id));
unset($task['task_id']);
$t->ins($task);
$new_task_id = $t->getid();
$title = $task['task_title'];
$title = preg_replace('#\\s*\\(\\d+\\)$#', '', $title);
$title .= " ({$new_task_id})";
$t->upd($new_task_id, array('task_title' => $title, 'forms_locked' => 0));
$sched['task_id'] = $new_task_id;
$s->ins($sched);
View::assign('study_id', $study_id);
return "study.tpl";
} catch (Exception $e) {
$this->err($e);
View::assign('error', $this->error);
return 'error.tpl';
}
}
示例3: forms2xml
/**
* make the $forms member and output it as xml
* this is what gets sent when a phone requests details for a task
*/
public function forms2xml($task_id, $study_id)
{
# this will set the forms and task members
$s = new Schedule();
$this->sched = $s->getone(array('task_id' => $task_id, 'study_id' => $study_id));
$this->parseforms($task_id);
return $this->formstring2xml();
}