public static function getPhpNameMap() { if (self::$phpNameMap === null) { $map = CourseSchedulePeer::getTableMap(); $columns = $map->getColumns(); $nameMap = array(); foreach ($columns as $column) { $nameMap[$column->getPhpName()] = $column->getColumnName(); } self::$phpNameMap = $nameMap; } return self::$phpNameMap; }
public function filter($c, $filters) { $filters_key = array_keys($filters); foreach ($filters_key as $key) { $value = $filters[$key]; if ($value == '' || $value == null) { continue; } if ($key == 'CODE_CLASS') { $c->addJoin(CourseSchedulePeer::CLASS_GROUP_ID, ClassGroupPeer::ID); $column = ClassGroupPeer::getTableMap()->getColumn('NAME'); } elseif ($key == 'EMPLOYEE_NAME') { $c->addJoin(CourseSchedulePeer::ID, CourseScheduleTutorPeer::COURSE_SCHEDULE_ID); $c->addJoin(CourseScheduleTutorPeer::EMPLOYEE_ID, EmployeePeer::ID); $column = EmployeePeer::getTableMap()->getColumn('NAME'); } elseif ($key == 'SUBJECT_ID') { $c->addJoin(SubjectPeer::ID, SubjectCurrPeer::SUBJECT_ID); $c->addJoin(SubjectCurrPeer::ID, CourseSchedulePeer::SUBJECT_CURR_ID); $column = SubjectCurrPeer::getTableMap()->getColumn($key); } elseif ($key == 'SUBJECT_NAME') { $c->addJoin(SubjectPeer::ID, SubjectCurrPeer::SUBJECT_ID); $c->addJoin(SubjectCurrPeer::ID, CourseSchedulePeer::SUBJECT_CURR_ID); $column = SubjectPeer::getTableMap()->getColumn('NAME'); } else { $column = CourseSchedulePeer::getTableMap()->getColumn($key); } $name = $column->getFullyQualifiedName(); $creoleType = $column->getCreoleType(); if ($creoleType == CreoleTypes::TIMESTAMP) { $from = $value['from']; $to = $value['to']; if ($from != '' && $from != null) { $c->add($name, $from, Criteria::GREATER_EQUAL); } if ($to != '' && $to != null) { $c->add($name, $to, Criteria::LESS_EQUAL); } } else { if ($creoleType == CreoleTypes::INTEGER) { $c->add($name, $value, Criteria::EQUAL); } else { if ($creoleType == CreoleTypes::VARCHAR) { $c->add($name, "%{$value}%", Criteria::LIKE); } } } } }
public function filterSchedule($c, $filters) { $filters_key = array_keys($filters); foreach ($filters_key as $key) { $value = $filters[$key]; if ($value == '' || $value == null) { continue; } if ($key == 'ACADEMIC_CALENDAR_ID') { $c->addJoin(AcademicCalendarPeer::ID, SubjectAccalPeer::ACADEMIC_CALENDAR_ID); $c->addJoin(CourseSchedulePeer::SUBJECT_ACCAL_ID, SubjectAccalPeer::ID); $column = SubjectAccalPeer::getTableMap()->getColumn($key); } elseif ($key == 'SUBJECT_ID') { $c->addJoin(SubjectPeer::ID, SubjectAccalPeer::SUBJECT_ID); $c->addJoin(SubjectAccalPeer::ID, CourseSchedulePeer::SUBJECT_ACCAL_ID); $column = SubjectAccalPeer::getTableMap()->getColumn($key); } else { $column = CourseSchedulePeer::getTableMap()->getColumn($key); } $name = $column->getFullyQualifiedName(); $creoleType = $column->getCreoleType(); if ($creoleType == CreoleTypes::TIMESTAMP) { $from = $value['from']; $to = $value['to']; if ($from != '' && $from != null) { $c->add($name, $from, Criteria::GREATER_EQUAL); } if ($to != '' && $to != null) { $c->add($name, $to, Criteria::LESS_EQUAL); } } else { if ($creoleType == CreoleTypes::INTEGER) { $c->add($name, $value, Criteria::EQUAL); } else { if ($creoleType == CreoleTypes::VARCHAR) { $c->add($name, "%{$value}%", Criteria::LIKE); } } } } }