当前位置: 首页>>代码示例>>PHP>>正文


PHP Division::getCourses方法代码示例

本文整理汇总了PHP中Division::getCourses方法的典型用法代码示例。如果您正苦于以下问题:PHP Division::getCourses方法的具体用法?PHP Division::getCourses怎么用?PHP Division::getCourses使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Division的用法示例。


在下文中一共展示了Division::getCourses方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
 {
     $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);
         }
     }
     $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:nvidela,项目名称:kimkelen,代码行数:25,代码来源:LvmSchoolBehaviour.class.php

示例2: 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::getCourses方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。