public static function getPhpNameMap()
 {
     if (self::$phpNameMap === null) {
         $map = PaymentJournalPeer::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 filterHistory($c, $filters)
 {
     $filters_key = array_keys($filters);
     foreach ($filters_key as $key) {
         $value = $filters[$key];
         if ($value == '' || $value == null) {
             continue;
         }
         if ($key == 'ACADEMIC_COST_COMPONENT_ID') {
             $c->addJoin(AcademicCostPeer::ACADEMIC_COST_COMPONENT_ID, AcademicCostComponentPeer::ID);
             $c->addJoin(PaymentJournalPeer::ACADEMIC_COST_ID, AcademicCostPeer::ID);
             $column = AcademicCostPeer::getTableMap()->getColumn($key);
         } elseif ($key == 'DEPARTMENT_ID') {
             $c->addJoin(DepartmentPeer::ID, CurriculumPeer::DEPARTMENT_ID);
             $c->addJoin(CurriculumPeer::ID, AcademicCalendarPeer::CURRICULUM_ID);
             $c->addJoin(AcademicCostPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
             $c->addJoin(PaymentJournalPeer::ACADEMIC_COST_ID, AcademicCostPeer::ID);
             $column = CurriculumPeer::getTableMap()->getColumn($key);
         } elseif ($key == 'PAYER') {
             $c->addJoin(StudentPeer::ID, PaymentJournalPeer::PAYER);
             $c->addJoin(StudentPeer::CURRICULUM_ID, AcademicCalendarPeer::CURRICULUM_ID);
             $c->addJoin(AcademicCostPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
             $c->addJoin(PaymentJournalPeer::ACADEMIC_COST_ID, AcademicCostPeer::ID);
             $column = StudentPeer::getTableMap()->getColumn('NAME');
         } elseif ($key == 'ACADEMIC_PROCESS_ID') {
             $c->addJoin(PaymentJournalPeer::ID, PaymentHistoryPeer::PAYMENT_JOURNAL_ID);
             $column = PaymentJournalPeer::getTableMap()->getColumn($key);
         } else {
             $column = PaymentHistoryPeer::getTableMap()->getColumn($key);
         }
         $name = $column->getFullyQualifiedName();
         $creoleType = $column->getCreoleType();
         if ($creoleType == CreoleTypes::TIMESTAMP) {
             $from = $value['from'];
             $to = $value['to'];
             $c2 = null;
             if ($from != '' && $from != null) {
                 $c->add($name, $from, Criteria::GREATER_EQUAL);
                 $c2 = $c->getCriterion($name);
             }
             if ($from != '' && $from != null && $to != '' && $to != null) {
                 $c3 = new Criterion($c, $name, $to, Criteria::LESS_EQUAL);
                 $c2->addAnd($c3);
             }
             if (($from == '' || $from == null) && $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 || $creoleType == CreoleTypes::CHAR) {
                     $c->add($name, "%{$value}%", Criteria::LIKE);
                 }
             }
         }
     }
 }
Beispiel #3
0
 public function filterStudent($c, $filters)
 {
     $filters_key = array_keys($filters);
     foreach ($filters_key as $key) {
         $value = $filters[$key];
         if ($value == '' || $value == null) {
             continue;
         }
         if ($key == 'DEPARTMENT_ID') {
             $c->addJoin(AcademicCalendarPeer::ID, StudentPeer::ACADEMIC_CALENDAR_ID);
             $c->addJoin(DepartmentPeer::ID, AcademicCalendarPeer::DEPARTMENT_ID);
             $column = DepartmentPeer::getTableMap()->getColumn('ID');
         } elseif ($key == 'CLASS_NAME') {
             $c->addJoin(ClassGroupPeer::ID, StudentPeer::CLASS_GROUP_ID);
             $column = ClassGroupPeer::getTableMap()->getColumn('NAME');
         } elseif ($key == 'ACADEMIC_COST_COMPONENT_ID') {
             $c->addJoin(PaymentJournalPeer::PAYER, StudentPeer::ID);
             $c->addJoin(AcademicCostPeer::ID, PaymentJournalPeer::ACADEMIC_COST_ID);
             $c->addJoin(AcademicCostComponentPeer::ID, AcademicCostPeer::ACADEMIC_COST_COMPONENT_ID);
             $column = AcademicCostComponentPeer::getTableMap()->getColumn('ID');
         } elseif ($key == 'PAID_AT') {
             $c->addJoin(PaymentJournalPeer::PAYER, StudentPeer::ID);
             $column = PaymentJournalPeer::getTableMap()->getColumn('PAID_AT');
         } elseif ($key == 'STATUS') {
             $c->addJoin(PaymentJournalPeer::PAYER, StudentPeer::ID);
             $column = PaymentJournalPeer::getTableMap()->getColumn('STATUS');
         } elseif ($key == 'PAYMENT_MODEL_ID') {
             $c->addJoin(PaymentJournalPeer::PAYER, StudentPeer::ID);
             $c->addJoin(PaymentModelPeer::ID, PaymentJournalPeer::PAYMENT_MODEL_ID);
             $column = PaymentModelPeer::getTableMap()->getColumn('ID');
         } else {
             $column = StudentPeer::getTableMap()->getColumn($key);
         }
         $name = $column->getFullyQualifiedName();
         $creoleType = $column->getCreoleType();
         if ($creoleType == CreoleTypes::TIMESTAMP) {
             $c->add($name, $value, Criteria::EQUAL);
         } else {
             if ($creoleType == CreoleTypes::DATE) {
                 $c->add($name, $value, Criteria::EQUAL);
             } else {
                 if ($creoleType == CreoleTypes::INTEGER) {
                     if ($name == StudentPeer::CLASS_GROUP_ID) {
                         $cg = ClassGroupPeer::retrieveByPK($value);
                         $c->add($name, $cg->getChildRecurs(), Criteria::IN);
                     } else {
                         $c->add($name, $value, Criteria::EQUAL);
                     }
                 } else {
                     if ($creoleType == CreoleTypes::VARCHAR || $creoleType == CreoleTypes::CHAR) {
                         $c->add($name, "%{$value}%", Criteria::LIKE);
                     }
                 }
             }
         }
     }
 }
Beispiel #4
0
 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 == 'ACADEMIC_COST_COMPONENT_ID') {
             $c->addJoin(AcademicCostPeer::ACADEMIC_COST_COMPONENT_ID, AcademicCostComponentPeer::ID);
             $c->addJoin(PaymentJournalPeer::ACADEMIC_COST_ID, AcademicCostPeer::ID);
             $column = AcademicCostPeer::getTableMap()->getColumn($key);
         } elseif ($key == 'PAYER_CODE') {
             $c->addJoin(StudentPeer::ID, PaymentJournalPeer::PAYER);
             $c->addJoin(StudentPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
             $c->addJoin(AcademicCostPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
             $c->addJoin(PaymentJournalPeer::ACADEMIC_COST_ID, AcademicCostPeer::ID);
             $column = StudentPeer::getTableMap()->getColumn('CODE');
         } elseif ($key == 'PAYER') {
             $c->addJoin(StudentPeer::ID, PaymentJournalPeer::PAYER);
             $c->addJoin(StudentPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
             $c->addJoin(AcademicCostPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
             $c->addJoin(PaymentJournalPeer::ACADEMIC_COST_ID, AcademicCostPeer::ID);
             $column = StudentPeer::getTableMap()->getColumn('NAME');
         } elseif ($key == 'DEPARTMENT_ID') {
             $c->addJoin(AcademicCostPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
             $c->addJoin(PaymentJournalPeer::ACADEMIC_COST_ID, AcademicCostPeer::ID);
             $column = AcademicCalendarPeer::getTableMap()->getColumn($key);
         } elseif ($key == 'CLASS_GROUP_ID') {
             $c->addJoin(StudentPeer::ID, PaymentJournalPeer::PAYER);
             $c->addJoin(StudentPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
             $c->addJoin(AcademicCostPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
             $c->addJoin(PaymentJournalPeer::ACADEMIC_COST_ID, AcademicCostPeer::ID);
             $column = StudentPeer::getTableMap()->getColumn('CLASS_GROUP_ID');
         } else {
             $column = PaymentJournalPeer::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 || $creoleType == CreoleTypes::CHAR) {
                 $c->add($name, $value, Criteria::EQUAL);
             } else {
                 if ($creoleType == CreoleTypes::VARCHAR) {
                     $c->add($name, "%{$value}%", Criteria::LIKE);
                 }
             }
         }
     }
 }