本文整理汇总了PHP中StudentPeer::doSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP StudentPeer::doSelect方法的具体用法?PHP StudentPeer::doSelect怎么用?PHP StudentPeer::doSelect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StudentPeer
的用法示例。
在下文中一共展示了StudentPeer::doSelect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: retrieveByCode
public static function retrieveByCode($member_code, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(StudentPeer::DATABASE_NAME);
$criteria->add(StudentPeer::CODE, $member_code);
$v = StudentPeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null;
}
示例2: getAvailableStudentsForExaminationRepprovedSubject
public static function getAvailableStudentsForExaminationRepprovedSubject(ExaminationRepprovedSubject $examination_repproved_subject)
{
if ($examination_repproved_subject->getExaminationRepproved()->getExaminationType() == ExaminationRepprovedType::FREE_GRADUATED) {
$c = self::getFreeGraduatedStudentsCriteria($examination_repproved_subject);
} else {
$c = self::getAvailableForExaminationRepprovedSubjectCriteria($examination_repproved_subject);
}
$c->addJoin(CourseSubjectStudentPeer::STUDENT_ID, StudentPeer::ID, Criteria::INNER_JOIN);
return StudentPeer::doSelect($c);
}
示例3: getStudents
/**
* This method returns the students related with this examinationRepprovedSubject
*
* @return array Students[]
*/
public function getStudents()
{
$c = new Criteria();
$c->add(StudentExaminationRepprovedSubjectPeer::EXAMINATION_REPPROVED_SUBJECT_ID, $this->getId());
$c->addJoin(StudentExaminationRepprovedSubjectPeer::STUDENT_REPPROVED_COURSE_SUBJECT_ID, StudentRepprovedCourseSubjectPeer::ID);
$c->addJoin(StudentRepprovedCourseSubjectPeer::COURSE_SUBJECT_STUDENT_ID, CourseSubjectStudentPeer::ID);
$c->addJoin(CourseSubjectStudentPeer::STUDENT_ID, StudentPeer::ID);
$c->addJoin(StudentPeer::PERSON_ID, PersonPeer::ID);
$c->addAscendingOrderByColumn(PersonPeer::LASTNAME);
return StudentPeer::doSelect($c);
}
示例4: buildCriteria
protected function buildCriteria()
{
if (is_null($this->filters)) {
$this->filters = $this->configuration->getFilterForm($this->getFilters());
}
$criteria = $this->filters->buildCriteria($this->getFilters());
$event = $this->dispatcher->filter(new sfEvent($this, 'admin.build_criteria'), $criteria);
$criteria = $event->getReturnValue();
$deserter_students = StudentPeer::getDeserterStudents();
$ids = array();
foreach ($deserter_students as $student) {
$ids[] = $student->getId();
}
$criteria->add(StudentPeer::ID, $ids, Criteria::IN);
$total_criteria_desertores = count(StudentPeer::doSelect($criteria));
$total_alumnos = count(StudentPeer::doSelect(new Criteria()));
$this->getUser()->setAttribute('students_count', $total_criteria_desertores);
$this->getUser()->setAttribute('students_percentaje', $total_criteria_desertores * 100 / $total_alumnos);
return $criteria;
}
示例5: execute
protected function execute($arguments = array(), $options = array())
{
// initialize the database connection
$databaseManager = new sfDatabaseManager($this->configuration);
$connection = $databaseManager->getDatabase($options['connection'] ? $options['connection'] : null)->getConnection();
// add your code here
$this->createContextInstance();
$i = 0;
$students = StudentPeer::doSelect(new Criteria());
$career_school_year = CareerSchoolYearPeer::retrieveByPK(4);
foreach ($students as $student) {
$this->logSection("Evaluando student ID = ", $student->getId());
$career_student = $student->getCareerStudent();
if ($career_student == null) {
$this->logSection("ceando CarrerStudent", $student->getId());
$career_student = new CareerStudent();
$career_student->setStudent($student);
$career_student->setCareerId(1);
$career_student->setStartYear(1);
$career_student->setFileNumber($student->getGlobalFileNumber());
$career_student->save($connection);
#$career_student->createStudentsCareerSubjectAlloweds(1, $connection);
$this->logSection("Fin creacion careerStudent", $career_student->getId());
}
$student_career_school_year = StudentCareerSchoolYearPeer::getCurrentForStudentAndCareerSchoolYear($student, $career_school_year);
if ($student_career_school_year == null) {
$i++;
$this->logSection("Creando studentCareerSchoolYear", $student->getId());
$student_career_school_year = new StudentCareerSchoolYear();
$student_career_school_year->setCareerSchoolYear($career_school_year);
$student_career_school_year->setStudent($student);
$student_career_school_year->setYear($student->getCareerStudent()->getStartYear());
$student_career_school_year->save($connection);
$this->logSection("Fin creacion studentCareerSchoolYear", $career_student->getId());
$this->logSection("Guardando", $student);
echo $i;
}
}
}
示例6: executeListFullTryout
public function executeListFullTryout()
{
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
$this->forward404Unless($employee);
$this->employee_id = $employee_id;
$this->employee = $employee;
$counseling = CounselingPeer::retrieveByPk($this->getRequestParameter('counseling_id'));
$this->forward404Unless($counseling);
$academic_calendar = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal_id'));
$this->forward404Unless($academic_calendar);
$c = new Criteria();
$c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
$c->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
$c->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID);
$c->add(StudentPeer::STATUS, 2, Criteria::NOT_EQUAL);
$c->add(StudentPeer::STATUS, 3, Criteria::NOT_EQUAL);
$c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME);
$this->students = StudentPeer::doSelect($c);
$this->student_count = StudentPeer::doCount($c);
$rpp = $this->getRequestParameter('max_per_page', 999);
$pager = new sfPropelPager('Student', $rpp);
$pager->setCriteria($c);
$pager->setPage($this->getRequestParameter('page', 1));
$pager->init();
$this->pager = $pager;
$grade_id = $this->getRequestParameter('grade_id');
$this->grade_id = $grade_id;
$cr = new Criteria();
$cr->add(GradeSpecPeer::PARENT, 45, Criteria::IN);
#$cr->add(GradeSpecPeer::ID, $grade_id, Criteria::NOT_IN);
$grade1 = GradeSpecPeer::doSelect($cr);
$count1 = GradeSpecPeer::doCount($cr);
$this->grade1 = $grade1;
$this->count1 = $count1;
$grade_current = GradeSpecPeer::retrieveByPk($grade_id);
$this->counseling = $counseling;
$this->academic_calendar = $academic_calendar;
$this->subtitle = $grade_current->getCode() . ' # ' . $counseling->getClassGroup()->getName() . ' - ' . $academic_calendar->toString();
#SMP
if ($academic_calendar->getDepartmentId() == 2) {
$cw = new Criteria();
$cw->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
$cw->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
$cton1 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 350, Criteria::IN);
$cton2 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 351, Criteria::IN);
$cton3 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 346, Criteria::IN);
$cton4 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 339, Criteria::IN);
$cton5 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 340, Criteria::IN);
$cton6 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 337, Criteria::IN);
$cton5->addOr($cton6);
$cton4->addOr($cton5);
$cton3->addOr($cton4);
$cton2->addOr($cton3);
$cton1->addOr($cton2);
$cw->add($cton1);
$cw->addAscendingOrderByColumn(VCoursePeer::CODE);
$this->smp_subjects = VCoursePeer::doSelect($cw);
$this->smp_count = VCoursePeer::doCount($cw);
$cd = new Criteria();
$cd->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
$cd->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
$cton1 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 352, Criteria::IN);
$cton2 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 349, Criteria::IN);
$cton3 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 348, Criteria::IN);
$cton4 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 341, Criteria::IN);
$cton5 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 355, Criteria::IN);
$cton4->addOr($cton5);
$cton3->addOr($cton4);
$cton2->addOr($cton3);
$cton1->addOr($cton2);
$cd->add($cton1);
$cd->addAscendingOrderByColumn(VCoursePeer::CODE);
$this->smp_subjects2 = VCoursePeer::doSelect($cd);
$this->smp_count2 = VCoursePeer::doCount($cd);
$cm = new Criteria();
$cm->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
$cm->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
$cton1 = $cm->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 353, Criteria::IN);
$cton2 = $cm->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 354, Criteria::IN);
$cton1->addOr($cton2);
$cm->add($cton1);
$cm->addAscendingOrderByColumn(VCoursePeer::CODE);
$this->ipas = VCoursePeer::doSelect($cm);
$this->ipa_count = VCoursePeer::doCount($cm);
$cl = new Criteria();
$cl->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
$cl->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
$cton1 = $cl->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 343, Criteria::IN);
$cton2 = $cl->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 338, Criteria::IN);
$cton3 = $cl->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 347, Criteria::IN);
$cton2->addOr($cton3);
$cton1->addOr($cton2);
$cl->add($cton1);
$cl->addAscendingOrderByColumn(VCoursePeer::CODE);
$this->ips = VCoursePeer::doSelect($cl);
$this->ips_count = VCoursePeer::doCount($cl);
#SD
} else {
if ($counseling->getClassGroup()->getParent() == 54) {
//.........这里部分代码省略.........
示例7: executeEditByEmployee
public function executeEditByEmployee()
{
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
$this->forward404Unless($employee);
$class_counseling = ClassCounselingPeer::retrieveByPk($this->getRequestParameter('id'));
$this->forward404Unless($class_counseling);
$student_options = array();
$c = new Criteria();
$c->add(StudentPeer::CLASS_GROUP_ID, $class_counseling->getCourseSchedule()->getClassGroupId(), Criteria::IN);
$c->addAscendingOrderByColumn(StudentPeer::NAME);
$students = StudentPeer::doSelect($c);
foreach ($students as $student) {
$student_options[$student->getId()] = $student->getName();
}
$this->student_options = $student_options;
$this->actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")), array('name' => 'cancel', 'url' => 'employee_counsel/list', 'color' => 'black'));
$this->subtitle = $class_counseling->toString() . ' - id:' . $class_counseling->getId();
$this->type = 'edit';
$actions2 = array(array('name' => '<span>Semester 1, ' . $class_counseling->getCourseSchedule()->getAcademicCalendar()->getParentName() . '</span>', 'url' => 'employee_counsel/list', 'color' => 'sun', 'type' => 'direct'));
array_push($actions2, array('name' => '<span>Semester 2, ' . $class_counseling->getCourseSchedule()->getAcademicCalendar()->getParentName() . '</span>', 'url' => 'employee_counsel/list2', 'color' => 'sky'));
array_push($actions2, array('name' => '<span>Riwayat Konseling</span>', 'url' => 'employee_counsel/listHistory', 'color' => 'volcadot'));
$this->actions2 = $actions2;
$this->class_counseling = $class_counseling;
$this->employee = $employee;
}
示例8: executeSavePreview
public function executeSavePreview()
{
$class_id = $this->getRequestParameter('class_group_id');
$accal_id = $this->getRequestParameter('academic_calendar_id');
$c = new Criteria();
$c->add(StudentPeer::CLASS_GROUP_ID, $this->getRequestParameter('class_group_id'));
$students = StudentPeer::doSelect($c);
$counts = StudentPeer::doCount($c);
$dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
if ($dept->getCourseModel() == Department::CM_TK) {
return $this->redirect('course_sched/listTK');
} else {
return $this->redirect('course_sched/list');
}
}
示例9: getStudents
public function getStudents($criteria = null, $con = null)
{
include_once 'lib/model/om/BaseStudentPeer.php';
if ($criteria === null) {
$criteria = new Criteria();
} elseif ($criteria instanceof Criteria) {
$criteria = clone $criteria;
}
if ($this->collStudents === null) {
if ($this->isNew()) {
$this->collStudents = array();
} else {
$criteria->add(StudentPeer::ACADEMIC_CALENDAR_ID, $this->getId());
StudentPeer::addSelectColumns($criteria);
$this->collStudents = StudentPeer::doSelect($criteria, $con);
}
} else {
if (!$this->isNew()) {
$criteria->add(StudentPeer::ACADEMIC_CALENDAR_ID, $this->getId());
StudentPeer::addSelectColumns($criteria);
if (!isset($this->lastStudentCriteria) || !$this->lastStudentCriteria->equals($criteria)) {
$this->collStudents = StudentPeer::doSelect($criteria, $con);
}
}
}
$this->lastStudentCriteria = $criteria;
return $this->collStudents;
}
示例10: executeSelectByClass
public function executeSelectByClass()
{
$class_id = $this->getRequestParameter('class_id');
$c = new Criteria();
$c->add(StudentPeer::CLASS_GROUP_ID, $class_id, Criteria::IN);
$c->addAscendingOrderByColumn(StudentPeer::NAME);
$objs = StudentPeer::doSelect($c);
$content = array();
$disabled = array();
foreach ($objs as $o) {
$content[$o->getId()] = $o->getName();
}
$this->content = $content;
$this->disabled = $disabled;
}
示例11: userStudentInit
private function userStudentInit()
{
$classArray = array();
$this->classOutput = array();
foreach ($this->classes as $class) {
$classArray[] = $class->getId();
$this->classOutput[$class->getId()] = array('id' => $class->getId(), 'code' => $class->getCode(), 'name' => $class->getName(), 'items' => array());
}
$studentCriteria = new Criteria();
$studentCriteria->add(StudentPeer::CLASS_GROUP_ID, $classArray, Criteria::IN);
$this->students = StudentPeer::doSelect($studentCriteria);
}
示例12: retrieveLastYearCareerGraduatedStudents
public static function retrieveLastYearCareerGraduatedStudents($career_school_year)
{
$last_year_school_year = SchoolYearPeer::retrieveLastYearSchoolYear(SchoolYearPeer::retrieveCurrent());
$c = new Criteria();
$c->addJoin(self::STUDENT_ID, StudentPeer::ID, Criteria::INNER_JOIN);
$c->add(self::STATUS, CareerStudentStatus::GRADUATE);
$c->add(self::GRADUATION_SCHOOL_YEAR_ID, $last_year_school_year->getId());
$c->add(self::CAREER_ID, $career_school_year->getCareer()->getId());
return StudentPeer::doSelect($c);
}
示例13: executeEditByEmployee
public function executeEditByEmployee()
{
$class_agenda = ClassAgendaPeer::retrieveByPK($this->getRequestParameter('agenda_id'));
$this->forward404Unless($class_agenda);
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
$this->forward404Unless($employee);
$this->employee = $employee;
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$c = new Criteria();
$c->add(JobPeer::CODE, 'leave/listByEmployee');
$job = JobPeer::doSelectOne($c);
$acl = AclPeer::retrieveByPK($group_id, $job->getId());
if (!$acl) {
$this->forward('default', 'error404');
}
$this->can_add = $acl->getAddPriv() == 1;
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
$student_absence = StudentAbsencePeer::retrieveByPk($this->getRequestParameter('id'));
$this->forward404Unless($student_absence);
$stu_options = array();
$c = new Criteria();
$c->add(StudentPeer::CLASS_GROUP_ID, $class_agenda->getClassGroupId(), Criteria::IN);
$c->addAscendingOrderByColumn(StudentPeer::NAME);
$students = StudentPeer::doSelect($c);
foreach ($students as $student) {
$stu_options[$student->getId()] = $student->getName();
}
$this->stu_options = $stu_options;
$actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
if ($acl->getRemovePriv()) {
array_push($actions, array('name' => 'delete', 'url' => 'leave/deleteByEmployee?id=' . $student_absence->getId() . '&agenda_id=' . $class_agenda->getId(), 'color' => 'red'));
}
array_push($actions, array('name' => 'cancel', 'url' => 'leave/listByEmployee?agenda_id=' . $class_agenda->getId(), 'color' => 'white'));
$this->subtitle = $class_agenda->toString() . ' - id:' . $student_absence->getId();
$this->type = 'edit';
$this->student_absence = $student_absence;
$this->actions = $actions;
$this->class_agenda = $class_agenda;
}
示例14: setBrothersForStudent
public static function setBrothersForStudent(Student $student)
{
$c = new Criteria();
$c->add(StudentPeer::ID, $student->getId(), Criteria::NOT_EQUAL);
self::$_brothers = array_merge($student->getBrothers(), StudentPeer::doSelect($c));
}
示例15: getStudents
public function getStudents(Criteria $c = null, PropelPDO $con = null)
{
if ($c == null) {
$c = new Criteria();
}
$c->add(StudentCareerSchoolYearPeer::CAREER_SCHOOL_YEAR_ID, $this->getId());
$c->addJoin(StudentCareerSchoolYearPeer::STUDENT_ID, StudentPeer::ID);
return StudentPeer::doSelect($c, $con);
}