當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserProfile::filterByPermissions方法代碼示例

本文整理匯總了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');
 }
開發者ID:hughnguy,項目名稱:php,代碼行數:14,代碼來源:Faculty.php

示例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');
 }
開發者ID:hughnguy,項目名稱:php,代碼行數:15,代碼來源:NOE.php


注:本文中的UserProfile::filterByPermissions方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。