public function toPHP($value, Driver $driver)
    {
        if ($value === null || strpos($value, '0000-00-00') === 0) {
            return null;
        }

        $instance = clone $this->_datetimeInstance;
        $instance = $instance->modify($value);

        if ($this->setToDateStart) {
            $instance = $instance->setTime(0, 0, 0);
        }

        return $instance;
    }
public function toPHP($value, Driver $driver)
    {
        if ($value === null || strpos($value, '0000-00-00') === 0) {
            return null;
        }

        $instance = clone $this->_datetimeInstance;
        $instance = $instance->modify($value);

        if ($this->setToDateStart) {
            $instance = $instance->setTime(0, 0, 0);
        }

        return $instance;
    }
public function toPHP ( $ value , Driver $ driver ) { if ( $ value === null || strpos ( $ value , '0000-00-00' ) === 0 ) { return null ; } $ instance = clone $ this -> _datetimeInstance ; $ instance = $ instance -> modify ( $ value ) ; if ( $ this -> setToDateStart ) { $ instance = $ instance -> setTime ( 0 , 0 , 0 ) ; } return $ instance ; }
Convert strings into DateTime instances.

@param string $value The value to convert.
@param \Cake\Database\Driver $driver The driver instance to convert with.
@return \Cake\I18n\Time|\DateTime|null
Convert strings into DateTime instances .