public static function getPhpNameMap() { if (self::$phpNameMap === null) { $map = JobCategoryPeer::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 == 'PUBLIC_INFORMATION_ID') { $c->addJoin(JobInformationPeer::JOB_ID, JobPeer::ID); $c->addJoin(PublicInformationPeer::ID, JobInformationPeer::PUBLIC_INFORMATION_ID); $column = PublicInformationPeer::getTableMap()->getColumn('ID'); } elseif ($key == 'JOB_CATEGORY_ID') { $c->addJoin(JobInformationPeer::JOB_ID, JobPeer::ID); $c->addJoin(JobCategoryPeer::ID, JobInformationPeer::JOB_CATEGORY_ID); $column = JobCategoryPeer::getTableMap()->getColumn('ID'); } else { $column = JobPeer::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); } else { if ($creoleType == CreoleTypes::CHAR) { $c->add($name, "%{$value}%", Criteria::LIKE); } } } } } }
public function filter($c, $filters) { $filters_key = array_keys($filters); foreach ($filters_key as $key) { $value = $filters[$key]; if ($value == '' || $value == null) { continue; } $column = JobCategoryPeer::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); } } } } }