本文整理汇总了PHP中Evaluation::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Evaluation::find方法的具体用法?PHP Evaluation::find怎么用?PHP Evaluation::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Evaluation
的用法示例。
在下文中一共展示了Evaluation::find方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: destroy
public function destroy($id)
{
$evaluation = Evaluation::find($id);
$evaluation->delete();
Session::flash('message', 'Successfully deleted the Evaluations!');
return Redirect::to('evaluations');
}
示例2: assignEvaluationAction
public function assignEvaluationAction()
{
$id = $this->getSanParam('id');
$this->view->assign('id', $id);
$evaluation = new Evaluation();
$rows = $evaluation->find($id);
$row = $rows->current();
$this->view->assign('evaluation', $row);
// restricted access?? only show trainings we have the ACL to view
require_once 'views/helpers/TrainingViewHelper.php';
$orgWhere = '';
$org_allowed_ids = allowed_organizer_access($this);
if ($org_allowed_ids) {
// doesnt have acl 'training_organizer_option_all'
$org_allowed_ids = implode(',', $org_allowed_ids);
$orgWhere = " training_organizer_option_id in ({$org_allowed_ids}) ";
}
// restricted access?? only show organizers that belong to this site if its a multi org site
$site_orgs = allowed_organizer_in_this_site($this);
// for sites to host multiple training organizers on one domain
$allowedWhereClause .= $site_orgs ? " AND training_organizer_option_id in ({$site_orgs}) " : "";
require_once 'models/table/Training.php';
$tableObj = new Training();
$trainings = $tableObj->getTrainings($orgWhere);
$assigned = $evaluation->fetchAssignments($id);
foreach ($trainings as $k => $r) {
$trainings[$k]['input_checkbox'] = '<input type="checkbox" name="training_ids[]" value="' . $r['training_id'] . '" ' . (array_search($r['training_id'], $assigned) !== false ? ' checked="checked" ' : '') . ' >';
}
$this->view->assign('trainings', $trainings);
$request = $this->getRequest();
if ($request->isPost()) {
$status = ValidationContainer::instance();
$training_ids = $this->getSanParam('training_ids');
$adjusted = array();
foreach ($training_ids as $tr) {
$adjusted[$tr] = $tr;
}
require_once 'models/table/MultiOptionList.php';
MultiOptionList::updateOptions('evaluation_to_training', 'training', 'evaluation_id', $id, 'training_id', $adjusted);
$_SESSION['status'] = t('The') . ' ' . t('Trainings') . ' ' . t('have been assigned.');
$status->setStatusMessage(t('The') . ' ' . t('Trainings') . ' ' . t('have been assigned.'));
$status->setRedirect('/evaluation/browse');
$this->sendData($status);
}
}
示例3: edit
public function edit($id)
{
$evaluation = Evaluation::find($id);
return View::make('evaluations.edit', compact('evaluation'));
}