1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-04 13:17:58 +02:00

Translator: fixed %dt with DateTimeInterface object [Closes #263]

This commit is contained in:
David Grudl
2017-09-21 14:03:37 +02:00
parent f29f52eb28
commit ecda8d0adf

View File

@@ -314,7 +314,7 @@ final class Translator
if ($value !== null && !is_scalar($value)) { // array is already processed if ($value !== null && !is_scalar($value)) { // array is already processed
if ($value instanceof Literal && ($modifier === 'sql' || $modifier === 'SQL')) { if ($value instanceof Literal && ($modifier === 'sql' || $modifier === 'SQL')) {
$modifier = 'SQL'; $modifier = 'SQL';
} elseif ($value instanceof \DateTimeInterface && ($modifier === 'd' || $modifier === 't')) { } elseif ($value instanceof \DateTimeInterface && ($modifier === 'd' || $modifier === 't' || $modifier === 'dt')) {
// continue // continue
} else { } else {
$type = is_object($value) ? get_class($value) : gettype($value); $type = is_object($value) ? get_class($value) : gettype($value);