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


PHP StudentPeer::doSelectStmt方法代码示例

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


在下文中一共展示了StudentPeer::doSelectStmt方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: joinWithStudents

 /**
  * This method joins the teacher indicated with the corresponing students.
  *
  * @return $criteria
  */
 public static function joinWithStudents(Criteria $c, $user_id)
 {
     $c1 = new Criteria();
     $c1->add(PersonPeer::USER_ID, $user_id);
     $c1->addJoin(PersonPeer::ID, TeacherPeer::PERSON_ID);
     $c1->addJoin(CourseSubjectTeacherPeer::TEACHER_ID, TeacherPeer::ID);
     $c1->addJoin(CourseSubjectTeacherPeer::COURSE_SUBJECT_ID, CourseSubjectPeer::ID);
     $c1->addJoin(CourseSubjectPeer::ID, CourseSubjectStudentPeer::COURSE_SUBJECT_ID);
     $c1->addJoin(CourseSubjectStudentPeer::STUDENT_ID, StudentPeer::ID);
     $c1->clearSelectColumns();
     $c1->addSelectColumn(StudentPeer::ID);
     $c1->setDistinct();
     $stmt = StudentPeer::doSelectStmt($c1);
     $student_ids = $stmt->fetchAll(PDO::FETCH_COLUMN);
     $c->add(StudentPeer::ID, $student_ids, Criteria::IN);
 }
开发者ID:nvidela,项目名称:kimkelen,代码行数:21,代码来源:TeacherPeer.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)
 {
     $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

示例3: getAvailableStudentsForDivisionCourseSubjectCriteria

 /**
  * This methods returns the students available four a course that have a Division
  *
  * @see getAvailableStudentsForCourseSubjectCriteria
  *
  * @param CourseSubject $course_subject
  * @param Criteria $criteria
  * @param Boolean $filter_by_orientation
  * @return Criteria
  */
 public function getAvailableStudentsForDivisionCourseSubjectCriteria(CourseSubject $course_subject, $criteria = null, $filter_by_orientation = true)
 {
     $criteria = is_null($criteria) ? new Criteria() : $criteria;
     if ($course_subject->getCourse()->getDivision()) {
         $c = new Criteria();
         $c->add(DivisionStudentPeer::DIVISION_ID, $course_subject->getCourse()->getDivisionId());
         $c->addJoin(StudentPeer::ID, DivisionStudentPeer::STUDENT_ID);
         $c->clearSelectColumns();
         $c->addSelectColumn(StudentPeer::ID);
         $stmt = StudentPeer::doSelectStmt($c);
         $in = $stmt->fetchAll(PDO::FETCH_COLUMN);
         $criteria->addAnd(StudentPeer::ID, $in, Criteria::IN);
     }
     return $this->getAvailableStudentsForCourseSubjectCriteria($course_subject, $criteria, $filter_by_orientation);
 }
开发者ID:palmegonzalez,项目名称:kimkelen,代码行数:25,代码来源:BaseSchoolBehaviour.class.php

示例4: addIsMatriculatedColumnCriteria

 public function addIsMatriculatedColumnCriteria($criteria, $field, $value)
 {
     if ($value != '') {
         $c = new Criteria();
         $c->add(SchoolYearPeer::ID, SchoolYearPeer::retrieveCurrent()->getId());
         $c->addJoin(SchoolYearPeer::ID, SchoolYearStudentPeer::SCHOOL_YEAR_ID);
         $c->addJoin(StudentPeer::ID, SchoolYearStudentPeer::STUDENT_ID);
         $c->clearSelectColumns();
         $c->addSelectColumn(StudentPeer::ID);
         $stmt = StudentPeer::doSelectStmt($c);
         $ids = $stmt->fetchAll(PDO::FETCH_COLUMN);
         if ($value == '1') {
             $criteria->add(StudentPeer::ID, $ids, Criteria::IN);
         } else {
             $criteria->add(StudentPeer::ID, $ids, Criteria::NOT_IN);
         }
     }
 }
开发者ID:nvidela,项目名称:kimkelen,代码行数:18,代码来源:StudentFormFilter.class.php

示例5: canBeClosed

 public function canBeClosed(PropelPDO $con = null)
 {
     if ($this->getIsClosed()) {
         return false;
     }
     if ($this->countStudents() == 0) {
         return false;
     }
     //busco los retirados o con reserva de banco
     $criteria = new Criteria();
     $criteria->addJoin(StudentCareerSchoolYearPeer::STUDENT_ID, StudentPeer::ID);
     $criterion = $criteria->getNewCriterion(StudentCareerSchoolYearPeer::STATUS, StudentCareerSchoolYearStatus::WITHDRAWN, Criteria::EQUAL);
     $criterion->addOr($criteria->getNewCriterion(StudentCareerSchoolYearPeer::STATUS, StudentCareerSchoolYearStatus::WITHDRAWN_WITH_RESERVE, Criteria::EQUAL));
     $criteria->add($criterion);
     $criteria->clearSelectColumns();
     $criteria->addSelectColumn(StudentPeer::ID);
     $stmt = StudentPeer::doSelectStmt($criteria);
     $ids = $stmt->fetchAll(PDO::FETCH_COLUMN);
     $c = new Criteria();
     $c->addJoin(CourseSubjectStudentMarkPeer::COURSE_SUBJECT_STUDENT_ID, CourseSubjectStudentPeer::ID);
     $c->addJoin(CourseSubjectStudentPeer::COURSE_SUBJECT_ID, CourseSubjectPeer::ID);
     $c->addJoin(CourseSubjectStudentPeer::STUDENT_ID, StudentPeer::ID);
     $c->add(CourseSubjectStudentPeer::IS_NOT_AVERAGEABLE, false);
     $c->addJoin(StudentPeer::PERSON_ID, PersonPeer::ID);
     $c->addJoin(PersonPeer::IS_ACTIVE, true);
     $c->addJoin(CourseSubjectPeer::COURSE_ID, $this->getId());
     $c->add(CourseSubjectStudentMarkPeer::MARK_NUMBER, $this->getCurrentPeriod());
     $c->add(CourseSubjectStudentMarkPeer::MARK, null, Criteria::ISNULL);
     $c->add(StudentPeer::ID, $ids, Criteria::NOT_IN);
     return CourseSubjectStudentMarkPeer::doCount($c) == 0 && $this->isCurrentSchoolYear();
 }
开发者ID:nvidela,项目名称:kimkelen,代码行数:31,代码来源:Course.php

示例6: getCourseSubjectStudents

 public function getCourseSubjectStudents($criteria = null, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria();
     }
     //busco los retirados o con reserva de banco
     $c = new Criteria();
     $c->addJoin(StudentCareerSchoolYearPeer::STUDENT_ID, StudentPeer::ID);
     $criterion = $c->getNewCriterion(StudentCareerSchoolYearPeer::STATUS, StudentCareerSchoolYearStatus::WITHDRAWN, Criteria::EQUAL);
     $criterion->addOr($c->getNewCriterion(StudentCareerSchoolYearPeer::STATUS, StudentCareerSchoolYearStatus::WITHDRAWN_WITH_RESERVE, Criteria::EQUAL));
     $c->add($criterion);
     $c->clearSelectColumns();
     $c->addSelectColumn(StudentPeer::ID);
     $stmt = StudentPeer::doSelectStmt($c);
     $ids = $stmt->fetchAll(PDO::FETCH_COLUMN);
     $criteria->addJoin(CourseSubjectStudentPeer::STUDENT_ID, StudentPeer::ID);
     $criteria->add(CourseSubjectStudentPeer::IS_NOT_AVERAGEABLE, false);
     $criteria->addJoin(StudentPeer::PERSON_ID, PersonPeer::ID);
     $criteria->addJoin(CourseSubjectStudentPeer::STUDENT_ID, StudentCareerSchoolYearPeer::STUDENT_ID);
     $criteria->add(StudentPeer::ID, $ids, Criteria::NOT_IN);
     $criteria->setDistinct();
     $criteria->addAscendingOrderByColumn(PersonPeer::LASTNAME);
     return parent::getCourseSubjectStudents($criteria);
 }
开发者ID:nvidela,项目名称:kimkelen,代码行数:24,代码来源:CourseSubject.php


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