public static function doSelectFiltered() { $criteria = new Criteria(); $depts = sfContext::getInstance()->getUser()->getAttribute('department', null, 'bo'); $criteria->add(ClassSessionPeer::DEPARTMENT_ID, $depts->getChildRecurs(), Criteria::IN); return ClassSessionPeer::doSelect($criteria); }
public static function retrieveByPKs($pks, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(); $criteria->add(ClassSessionPeer::ID, $pks, Criteria::IN); $objs = ClassSessionPeer::doSelect($criteria, $con); } return $objs; }
public function executeSchedule() { $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($course_schedule); $accal_id = $course_schedule->getAcademicCalendarId(); $subject_id = $course_schedule->getSubjectCurr()->getSubjectId(); $course_id = $course_schedule->getId(); $class_sessions = array(); $c = new Criteria(); $c->addAscendingOrderByColumn(ClassSessionPeer::ID); $class = ClassSessionPeer::doSelect($c); foreach ($class as $clas) { $class_sessions[$clas->getId()] = $clas->toString(); } $this->class_sessions = $class_sessions; $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); array_push($actions, array('name' => 'cancel', 'url' => 'course_schedule/preview?class_group_id=' . $course_schedule->getClassGroupId() . '&accal_id=' . $course_schedule->getAcademicCalendarId(), 'color' => 'white')); $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - id:' . $course_schedule->getId(); $this->type = 'edit'; $this->course_schedule = $course_schedule; $this->actions = $actions; $this->accal_id = $accal_id; $this->subject_id = $subject_id; $this->course_id = $course_id; }