Esempio n. 1
0
 /**
  * Convert strings into Date instances.
  *
  * @param string $value The value to convert.
  * @param \Cake\Database\Driver $driver The driver instance to convert with.
  * @return \Carbon\Carbon
  */
 public function toPHP($value, Driver $driver)
 {
     $date = parent::toPHP($value, $driver);
     if ($date instanceof DateTime) {
         $date->setTime(0, 0, 0);
     }
     return $date;
 }
Esempio n. 2
0
 /**
  * Convert request data into a datetime object.
  *
  * @param mixed $value Request data
  * @return \DateTime
  */
 public function marshal($value)
 {
     $date = parent::marshal($value);
     if ($date instanceof \DateTime) {
         $date->setTime(0, 0, 0);
     }
     return $date;
 }