本文整理汇总了PHP中Evaluation::createEvaluationObjectsFromEntities方法的典型用法代码示例。如果您正苦于以下问题:PHP Evaluation::createEvaluationObjectsFromEntities方法的具体用法?PHP Evaluation::createEvaluationObjectsFromEntities怎么用?PHP Evaluation::createEvaluationObjectsFromEntities使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Evaluation
的用法示例。
在下文中一共展示了Evaluation::createEvaluationObjectsFromEntities方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_evaluations_with_result_for_student
/**
* Retrieve evaluations where a student has results for
* and return them as an array of Evaluation objects
* @param int $cat_id parent category (use 'null' to retrieve them in all categories)
* @param int $stud_id student id
*/
public static function get_evaluations_with_result_for_student($cat_id = null, $stud_id)
{
$em = Database::getManager();
$query = $em->createQuery();
$dql = '
SELECT ge FROM ChamiloCoreBundle:GradebookEvaluation ge
WHERE gc IN (
SELECT gr.evaluationId FROM ChamiloCoreBundle:GradebookResult gr
WHERE gr.userId = :user AND gr.score IS NOT NULL
)
';
$queryParams = ['user' => intval($stud_id)];
if (!api_is_allowed_to_edit()) {
$dql .= 'AND ge.visible = 1 ';
}
if (isset($cat_id)) {
$dql .= 'AND ge.categoryId = :category ';
$queryParams['category'] = intval($cat_id);
} else {
$dql .= 'AND ge.categoryId >= 0 ';
}
$result = $query->setParameters($queryParams)->getResult();
$alleval = Evaluation::createEvaluationObjectsFromEntities($result);
return $alleval;
}