Exemplo n.º 1
0
 public static function getPhpNameMap()
 {
     if (self::$phpNameMap === null) {
         $map = InboxStuPeer::getTableMap();
         $columns = $map->getColumns();
         $nameMap = array();
         foreach ($columns as $column) {
             $nameMap[$column->getPhpName()] = $column->getColumnName();
         }
         self::$phpNameMap = $nameMap;
     }
     return self::$phpNameMap;
 }
Exemplo n.º 2
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 = InboxStuPeer::getTableMap()->getColumn($key);
         $name = $column->getFullyQualifiedName();
         $creoleType = $column->getCreoleType();
         if ($creoleType == CreoleTypes::DATE) {
             $c->add($name, $value, Criteria::LIKE);
         } 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);
                 }
             }
         }
     }
 }