DateTime stuff for PHP 5.3
ini_get('date.timezone') seems to not behave properly though... defaults to America/Toronto.
This commit is contained in:
parent
4022afa8b9
commit
d65cc390a5
10 changed files with 369 additions and 307 deletions
|
@ -185,29 +185,20 @@ abstract class BaseCcAccessQuery extends ModelCriteria
|
|||
/**
|
||||
* Filter the query on the gunid column
|
||||
*
|
||||
* @param string|array $gunid The value to use as filter.
|
||||
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
|
||||
* @param string $gunid The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return CcAccessQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByGunid($gunid = null, $comparison = null)
|
||||
{
|
||||
if (is_array($gunid)) {
|
||||
$useMinMax = false;
|
||||
if (isset($gunid['min'])) {
|
||||
$this->addUsingAlias(CcAccessPeer::GUNID, $gunid['min'], Criteria::GREATER_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if (isset($gunid['max'])) {
|
||||
$this->addUsingAlias(CcAccessPeer::GUNID, $gunid['max'], Criteria::LESS_EQUAL);
|
||||
$useMinMax = true;
|
||||
}
|
||||
if ($useMinMax) {
|
||||
return $this;
|
||||
}
|
||||
if (null === $comparison) {
|
||||
if (null === $comparison) {
|
||||
if (is_array($gunid)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $gunid)) {
|
||||
$gunid = str_replace('*', '%', $gunid);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
return $this->addUsingAlias(CcAccessPeer::GUNID, $gunid, $comparison);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue