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


PHP Division::getCareerSchoolYear方法代碼示例

本文整理匯總了PHP中Division::getCareerSchoolYear方法的典型用法代碼示例。如果您正苦於以下問題:PHP Division::getCareerSchoolYear方法的具體用法?PHP Division::getCareerSchoolYear怎麽用?PHP Division::getCareerSchoolYear使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Division的用法示例。


在下文中一共展示了Division::getCareerSchoolYear方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getAvailableStudentsForDivision

 /**
  * Get every student that isnt inscripted in other division.
  * The inscription depends on the aproval method implemented by each school
  *
  * @param  Division     $division
  *
  * @return array Student[]
  */
 public function getAvailableStudentsForDivision(Division $division)
 {
     // Get students just inscripted in other divisions
     $not_in_criteria = new Criteria();
     $not_in_criteria->addJoin(DivisionStudentPeer::STUDENT_ID, StudentPeer::ID);
     $not_in_criteria->addJoin(DivisionStudentPeer::DIVISION_ID, DivisionPeer::ID, Criteria::INNER_JOIN);
     $not_in_criteria->add(DivisionPeer::CAREER_SCHOOL_YEAR_ID, $division->getCareerSchoolYear()->getId());
     $not_in_criteria->clearSelectColumns();
     $not_in_criteria->addSelectColumn(StudentPeer::ID);
     $stmt = StudentPeer::doSelectStmt($not_in_criteria);
     $not_in = $stmt->fetchAll(PDO::FETCH_COLUMN);
     $students_in = array();
     foreach ($division->getCourses() as $course) {
         foreach ($course->getNonOptionCourseSubjects() as $course_subject) {
             $criteria_course = $this->getAvailableStudentsForCourseSubjectCriteria($course_subject);
             $criteria_course->clearSelectColumns();
             $criteria_course->addSelectColumn(StudentPeer::ID);
             $stmt = StudentPeer::doSelectStmt($criteria_course);
             $students_in = array_merge($stmt->fetchAll(PDO::FETCH_COLUMN), $students_in);
         }
     }
     $students_in = array_diff($students_in, $not_in);
     $c = new Criteria();
     //$c->addAnd(StudentPeer::ID,$not_in,Criteria::NOT_IN);
     $c->add(StudentPeer::ID, $students_in, Criteria::IN);
     return StudentPeer::doSelect($c);
 }
開發者ID:palmegonzalez,項目名稱:kimkelen,代碼行數:35,代碼來源:BaseSchoolBehaviour.class.php


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