コード例 #1
0
ファイル: DateType.php プロジェクト: gmanno/cakephp
 /**
  * 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;
 }
コード例 #2
0
ファイル: DateType.php プロジェクト: ripzappa0924/carte0.0.1
 /**
  * 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;
 }