/** * {@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); }
public function convertToPHPValue($value, \Doctrine\DBAL\Platforms\AbstractPlatform $platform) { $value = parent::convertToPHPValue($value, $platform); if ($value !== NULL) { $value = DateKey::fromDateTime($value); } return $value; }
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) { return sprintf("%s COMMENT '%s' ", parent::getSQLDeclaration($fieldDeclaration, $platform), $platform->getDoctrineTypeComment($this)); }
public function convertToPHPValue($value, AbstractPlatform $platform) { $value = parent::convertToPHPValue($value, $platform); return isset($value) ? \Carbon\Carbon::instance($value) : $value; }