| @@ 25-28 (lines=4) @@ | ||
| 22 | } |
|
| 23 | ||
| 24 | $args = $query->getArgs(); |
|
| 25 | foreach ($args as &$arg) if ($arg instanceof \DateTime) { |
|
| 26 | if ($arg->format('H:i:s') == '00:00:00') $arg = $arg->format('Y-m-d'); |
|
| 27 | else $arg = $arg->format('Y-m-d H:i:s'); |
|
| 28 | } |
|
| 29 | ||
| 30 | if ($stmt !== false) { |
|
| 31 | try { |
|
| @@ 21-24 (lines=4) @@ | ||
| 18 | foreach ($data as $field => $value) { |
|
| 19 | //For dates with times set, search on time, if the time is not set, search on date only. |
|
| 20 | //E.g. searching for all records posted on '2015-11-14' should return all records that day, not just the ones posted at 00:00:00 on that day |
|
| 21 | if ($value instanceof \DateTime) { |
|
| 22 | if ($value->format('H:i:s') == '00:00:00') $value = $value->format('Y-m-d'); |
|
| 23 | else $value = $value->format('Y-m-d H:i:s'); |
|
| 24 | } |
|
| 25 | if (is_object($value)) continue; |
|
| 26 | if ($prependField){ |
|
| 27 | $sql[] = $this->quote($field) . ' = :' . $field; |
|