original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Convert strings into DateTime instances .