Skip to content
Permalink
Browse files

Minor optimization for DateTimeType

  • Loading branch information...
lorenzo committed May 31, 2016
1 parent 445e0cc commit 2d153f080c16483c8a44346b5ddfce1673263c5e
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/Database/Type/DateTimeType.php
@@ -121,6 +121,10 @@ public function toPHP($value, Driver $driver)
list($value) = explode('.', $value);
}
if ($this->_datetimeInstance === null) {
$this->_datetimeInstance = new $this->_className;
}
$instance = clone $this->_datetimeInstance;
return $instance->modify($value);
}
@@ -251,7 +255,7 @@ protected function _setClassName($class, $fallback)
$class = $fallback;
}
$this->_className = $class;
$this->_datetimeInstance = new $this->_className;
$this->_datetimeInstance = null;
}
/**

0 comments on commit 2d153f0

Please sign in to comment.
You can’t perform that action at this time.