1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-02 20:27:35 +02:00

Merge pull request #129 from erikfercak/add_apostrophes_to_dates

Add aposthrophes back to dates
This commit is contained in:
David Grudl
2014-02-22 04:08:22 +01:00
7 changed files with 7 additions and 7 deletions

View File

@@ -281,7 +281,7 @@ class DibiFirebirdDriver extends DibiObject implements IDibiDriver, IDibiResultD
if (!$value instanceof DateTime) {
$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:
throw new InvalidArgumentException('Unsupported type.');

View File

@@ -237,7 +237,7 @@ class DibiMsSql2005Driver extends DibiObject implements IDibiDriver, IDibiResult
if (!$value instanceof DateTime) {
$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:
throw new InvalidArgumentException('Unsupported type.');

View File

@@ -222,7 +222,7 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver, IDibiResultDriv
if (!$value instanceof DateTime) {
$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:
throw new InvalidArgumentException('Unsupported type.');

View File

@@ -316,7 +316,7 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver, IDibiResultDriv
if (!$value instanceof DateTime) {
$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:
throw new InvalidArgumentException('Unsupported type.');

View File

@@ -304,7 +304,7 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver, IDibiResultDri
if (!$value instanceof DateTime) {
$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:
throw new InvalidArgumentException('Unsupported type.');

View File

@@ -282,7 +282,7 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver, IDibiResultDriver
if (!$value instanceof DateTime) {
$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:
throw new InvalidArgumentException('Unsupported type.');

View File

@@ -297,7 +297,7 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver, IDibiResultDr
if (!$value instanceof DateTime) {
$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:
throw new InvalidArgumentException('Unsupported type.');