Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function convertToPHPValue($value, AbstractPlatform $platform)
 {
     if ($value === null) {
         return $value;
     }
     return Carbon::instance(parent::convertToPHPValue($value, $platform));
 }
 public function convertToPHPValue($value, AbstractPlatform $platform)
 {
     $result = parent::convertToPHPValue($value, $platform);
     if ($result instanceof \DateTime) {
         return Carbon::instance($result);
     }
     return $result;
 }
 /**
  * {@inheritdoc}
  */
 public function convertToDatabaseValue($value, AbstractPlatform $platform)
 {
     if ($value === null) {
         return null;
     }
     $value->setTimeZone(self::$utc ? self::$utc : (self::$utc = new \DateTimeZone('UTC')));
     return parent::convertToDatabaseValue($value, $platform);
 }
Пример #4
0
 public function convertToPHPValue($value, \Doctrine\DBAL\Platforms\AbstractPlatform $platform)
 {
     $value = parent::convertToPHPValue($value, $platform);
     if ($value !== NULL) {
         $value = DateKey::fromDateTime($value);
     }
     return $value;
 }
Пример #5
0
 public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
 {
     return sprintf("%s COMMENT '%s' ", parent::getSQLDeclaration($fieldDeclaration, $platform), $platform->getDoctrineTypeComment($this));
 }
Пример #6
0
 public function convertToPHPValue($value, AbstractPlatform $platform)
 {
     $value = parent::convertToPHPValue($value, $platform);
     return isset($value) ? \Carbon\Carbon::instance($value) : $value;
 }