本文整理汇总了PHP中UserProfile::filterByPermissions方法的典型用法代码示例。如果您正苦于以下问题:PHP UserProfile::filterByPermissions方法的具体用法?PHP UserProfile::filterByPermissions怎么用?PHP UserProfile::filterByPermissions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserProfile
的用法示例。
在下文中一共展示了UserProfile::filterByPermissions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchAllStudentsExcel
/**
* Given a user and semester, fetch all students (excel friendly)
* @param array $accommodations The accommodations to filter by
* @param int $faculty_user_id The faculty user ID
* @param string $semester
* @return array
*/
public function fetchAllStudentsExcel(array $accommodations, $faculty_user_id, $semester)
{
$semester = $this->db->clean($semester);
$sql = "SELECT v.student_num AS column0, CONCAT(s.first_name, ' ', s.last_name) AS column1,\n s.email AS column2, c.code AS column3, c.section AS column4,\n GROUP_CONCAT(CONCAT(cc.professor_first_name, ' ', cc.professor_last_name) SEPARATOR ', ') AS column5,\n cc.professor_email AS column6, cc.teaching_method AS column7\n FROM org_student_course_classes y\n JOIN ventus_students v\n ON y.student_id = v.student_num\n JOIN org_students s\n ON v.student_num = s.student_id\n JOIN org_course_classes cc\n ON y.class_id = cc.class_id\n JOIN org_courses c\n ON c.course_id = cc.course_id\n JOIN ventus_student_accommodations vsa\n ON v.student_num = vsa.student_num\n LEFT JOIN ventus_student_accommodations_exceptions vsae\n ON v.student_num = vsae.student_num\n AND vsae.course_code = c.code\n AND vsae.course_section = c.section\n AND vsae.session = c.session\n LEFT JOIN ventus_students_courses_no_accommodations vscna\n ON v.student_num = vscna.student_num\n JOIN ventus_accommodations va \n ON vsa.accommodation_id = va.accommodation_id \n OR vsae.accommodation_id = va.accommodation_id \n JOIN ventus_accommodation_types vat \n ON va.type_id = vat.type_id\n WHERE v.access_profile_status='active'\n AND c.session = '{$semester}'\n AND (CURDATE() BETWEEN vsa.effective_on AND vsa.expires_on \n OR CURDATE() BETWEEN vsae.effective_on AND vsae.expires_on)\n AND vscna.opt_out_id IS NULL \n AND vat.category IN ('" . implode("','", $accommodations) . "')\n GROUP BY v.student_num, c.code, c.section, c.session, cc.teaching_method";
$students = $this->db->query($sql);
return $this->facultyUserModel->filterByPermissions($faculty_user_id, $students, 'column3', 'column4');
}
示例2: fetchNoticeDetailsForExport
/**
* For a given user, fetch all NOEs (Excel friendly)
* @param int $faculty_user_id The faculty user ID
* @param string $start The start of the date range
* @param string $end The end of the date range
* @return array
*/
public function fetchNoticeDetailsForExport($faculty_user_id, $start, $end)
{
if (!ctype_digit($faculty_user_id) && !is_int($faculty_user_id)) {
throw new \InvalidArgumentException('Invalid user ID');
}
$exams = parent::fetchNoticeDetailsForExport($start, $end);
return $this->facultyUserModel->filterByPermissions($faculty_user_id, $exams, 'column0', 'column1');
}