本文整理汇总了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();
}