mirror of
https://github.com/dg/dibi.git
synced 2025-08-05 13:47:33 +02:00
Add aposthrophes back to dates
Commit 7318658017
removed apostrophes from dates and that caused
dibi to build different queries. Compare:
...WHERE `date_created` < '2014-02-21';
vs.
...WHERE `date_created` < 2014-02-21;
This commit is contained in:
@@ -281,7 +281,7 @@ class DibiFirebirdDriver extends DibiObject implements IDibiDriver, IDibiResultD
|
|||||||
if (!$value instanceof DateTime) {
|
if (!$value instanceof DateTime) {
|
||||||
$value = new DibiDateTime($value);
|
$value = new DibiDateTime($value);
|
||||||
}
|
}
|
||||||
return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "Y-m-d");
|
return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "'Y-m-d'");
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new InvalidArgumentException('Unsupported type.');
|
throw new InvalidArgumentException('Unsupported type.');
|
||||||
|
@@ -237,7 +237,7 @@ class DibiMsSql2005Driver extends DibiObject implements IDibiDriver, IDibiResult
|
|||||||
if (!$value instanceof DateTime) {
|
if (!$value instanceof DateTime) {
|
||||||
$value = new DibiDateTime($value);
|
$value = new DibiDateTime($value);
|
||||||
}
|
}
|
||||||
return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "Y-m-d");
|
return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "'Y-m-d'");
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new InvalidArgumentException('Unsupported type.');
|
throw new InvalidArgumentException('Unsupported type.');
|
||||||
|
@@ -222,7 +222,7 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver, IDibiResultDriv
|
|||||||
if (!$value instanceof DateTime) {
|
if (!$value instanceof DateTime) {
|
||||||
$value = new DibiDateTime($value);
|
$value = new DibiDateTime($value);
|
||||||
}
|
}
|
||||||
return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "Y-m-d");
|
return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "'Y-m-d'");
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new InvalidArgumentException('Unsupported type.');
|
throw new InvalidArgumentException('Unsupported type.');
|
||||||
|
@@ -316,7 +316,7 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver, IDibiResultDriv
|
|||||||
if (!$value instanceof DateTime) {
|
if (!$value instanceof DateTime) {
|
||||||
$value = new DibiDateTime($value);
|
$value = new DibiDateTime($value);
|
||||||
}
|
}
|
||||||
return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "Y-m-d");
|
return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "'Y-m-d'");
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new InvalidArgumentException('Unsupported type.');
|
throw new InvalidArgumentException('Unsupported type.');
|
||||||
|
@@ -304,7 +304,7 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver, IDibiResultDri
|
|||||||
if (!$value instanceof DateTime) {
|
if (!$value instanceof DateTime) {
|
||||||
$value = new DibiDateTime($value);
|
$value = new DibiDateTime($value);
|
||||||
}
|
}
|
||||||
return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "Y-m-d");
|
return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "'Y-m-d'");
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new InvalidArgumentException('Unsupported type.');
|
throw new InvalidArgumentException('Unsupported type.');
|
||||||
|
@@ -282,7 +282,7 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver, IDibiResultDriver
|
|||||||
if (!$value instanceof DateTime) {
|
if (!$value instanceof DateTime) {
|
||||||
$value = new DibiDateTime($value);
|
$value = new DibiDateTime($value);
|
||||||
}
|
}
|
||||||
return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "Y-m-d");
|
return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "'Y-m-d'");
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new InvalidArgumentException('Unsupported type.');
|
throw new InvalidArgumentException('Unsupported type.');
|
||||||
|
@@ -297,7 +297,7 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver, IDibiResultDr
|
|||||||
if (!$value instanceof DateTime) {
|
if (!$value instanceof DateTime) {
|
||||||
$value = new DibiDateTime($value);
|
$value = new DibiDateTime($value);
|
||||||
}
|
}
|
||||||
return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "Y-m-d");
|
return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "'Y-m-d'");
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new InvalidArgumentException('Unsupported type.');
|
throw new InvalidArgumentException('Unsupported type.');
|
||||||
|
Reference in New Issue
Block a user