예제 #1
0
 public static function getPhpNameMap()
 {
     if (self::$phpNameMap === null) {
         $map = VTotalStudentPeer::getTableMap();
         $columns = $map->getColumns();
         $nameMap = array();
         foreach ($columns as $column) {
             $nameMap[$column->getPhpName()] = $column->getColumnName();
         }
         self::$phpNameMap = $nameMap;
     }
     return self::$phpNameMap;
 }
예제 #2
0
 public function filterCollectionRatio($c, $filters)
 {
     $filters_key = array_keys($filters);
     foreach ($filters_key as $key) {
         $value = $filters[$key];
         if ($value == '' || $value == null) {
             continue;
         }
         if ($key == 'TOTAL_MEMBER') {
             $c->addJoin(VTotalStudentPeer::DEPARTMENT_ID, VTotalEksemplarPeer::DEPARTMENT_ID);
             $column = VTotalStudentPeer::getTableMap()->getColumn('TOTAL_MEMBER');
         } elseif ($key == 'DEPARTMENT_ID') {
             $column = VTotalEksemplarPeer::getTableMap()->getColumn('DEPARTMENT_ID');
         } elseif ($key == 'TOTAL_COLLECTION') {
             $column = VTotalEksemplarPeer::getTableMap()->getColumn('TOTAL_COLLECTION');
         } else {
             $column = VTotalEksemplarPeer::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::BIGINT) {
                 $c->add($name, $value, Criteria::EQUAL);
             } else {
                 if ($creoleType == CreoleTypes::VARCHAR) {
                     $c->add($name, "%{$value}%", Criteria::LIKE);
                 }
             }
         }
     }
 }