From 367b115ad2f99d2e5b149505331db0552601e8fd Mon Sep 17 00:00:00 2001 From: David Grudl Date: Thu, 12 Dec 2013 16:23:19 +0100 Subject: [PATCH] DibiRow: null time checking consistent with DibiResult --- dibi/libs/DibiRow.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/dibi/libs/DibiRow.php b/dibi/libs/DibiRow.php index 476f2bd7..6f22bbb0 100644 --- a/dibi/libs/DibiRow.php +++ b/dibi/libs/DibiRow.php @@ -43,7 +43,7 @@ class DibiRow implements ArrayAccess, IteratorAggregate, Countable { $time = $this[$key]; if (!$time instanceof DibiDateTime) { - if ((int) $time === 0) { // '', NULL, FALSE, '0000-00-00', ... + if ((int) $time === 0 && substr((string) $time, 0, 3) !== '00:') { // '', NULL, FALSE, '0000-00-00', ... return NULL; } $time = new DibiDateTime($time); @@ -60,11 +60,7 @@ class DibiRow implements ArrayAccess, IteratorAggregate, Countable public function asTimestamp($key) { trigger_error(__METHOD__ . '() is deprecated.', E_USER_WARNING); - $time = $this[$key]; - if ((int) $time !== 0) { // '', NULL, FALSE, '0000-00-00', ... - $time = new DibiDateTime($time); - return $time->getTimestamp(); - } + return $this->asDateTime($key, 'U'); }