Beispiel #1
0
 public static function getPhpNameMap()
 {
     if (self::$phpNameMap === null) {
         $map = LocationPeer::getTableMap();
         $columns = $map->getColumns();
         $nameMap = array();
         foreach ($columns as $column) {
             $nameMap[$column->getPhpName()] = $column->getColumnName();
         }
         self::$phpNameMap = $nameMap;
     }
     return self::$phpNameMap;
 }
Beispiel #2
0
 public function filterLocation($c, $filters)
 {
     $filters_key = array_keys($filters);
     foreach ($filters_key as $key) {
         $value = $filters[$key];
         if ($value == '' || $value == null) {
             continue;
         }
         if ($key == 'YEAR') {
             $c->addJoin(AcademicCalendarPeer::ID, LocationPeer::ACADEMIC_CALENDAR_ID);
             $column = AcademicCalendarPeer::getTableMap()->getColumn('NAME');
         } else {
             $column = LocationPeer::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);
                 }
             }
         }
     }
 }
Beispiel #3
0
 public function filter($c, $filters)
 {
     $filters_key = array_keys($filters);
     foreach ($filters_key as $key) {
         $value = $filters[$key];
         if ($value == '' || $value == null) {
             continue;
         }
         $column = LocationPeer::getTableMap()->getColumn($key);
         $name = $column->getFullyQualifiedName();
         $creoleType = $column->getCreoleType();
         if ($creoleType == CreoleTypes::TIMESTAMP) {
             $c->add($name, $value, Criteria::EQUAL);
         } else {
             if ($creoleType == CreoleTypes::INTEGER) {
                 $c->add($name, $value, Criteria::EQUAL);
             } else {
                 if ($creoleType == CreoleTypes::VARCHAR) {
                     $c->add($name, "%{$value}%", Criteria::LIKE);
                 }
             }
         }
     }
 }
Beispiel #4
0
 public function filterApplicant($c, $filters)
 {
     $filters_key = array_keys($filters);
     foreach ($filters_key as $key) {
         $value = $filters[$key];
         if ($value == '' || $value == null) {
             continue;
         }
         if ($key == 'NAME') {
             $c->addJoin(TestApplicantPeer::ID, TestApplSchedPeer::TEST_APPLICANT_ID);
             $column = TestApplicantPeer::getTableMap()->getColumn('NAME');
         } elseif ($key == 'CODE') {
             $c->addJoin(TestApplicantPeer::ID, TestApplSchedPeer::TEST_APPLICANT_ID);
             $column = TestApplicantPeer::getTableMap()->getColumn('CODE');
         } elseif ($key == 'LOCATION_ID') {
             $c->addJoin(TestSchedulePeer::ID, TestApplSchedPeer::TEST_SCHEDULE_ID);
             $c->addJoin(LocationPeer::ID, TestSchedulePeer::LOCATION_ID);
             $column = LocationPeer::getTableMap()->getColumn('ID');
         } elseif ($key == 'STATUS') {
             $cr->addJoin(TestApplicantPeer::ID, TestApplSchedPeer::TEST_APPLICANT_ID);
             $column = TestApplicantPeer::getTableMap()->getColumn('STATUS');
         } else {
             $column = TestApplSchedulePeer::getTableMap()->getColumn($key);
         }
         $name = $column->getFullyQualifiedName();
         $creoleType = $column->getCreoleType();
         if ($creoleType == CreoleTypes::TIMESTAMP) {
             $c->add($name, $value, Criteria::EQUAL);
         } else {
             if ($creoleType == CreoleTypes::INTEGER) {
                 $c->add($name, $value, Criteria::EQUAL);
             } else {
                 if ($creoleType == CreoleTypes::VARCHAR) {
                     $c->add($name, "%{$value}%", Criteria::LIKE);
                 }
             }
         }
     }
 }