/home/techb158/immovalet.com/vendor/doctrine/dbal/src/Types
Edit: /home/techb158/immovalet.com/vendor/doctrine/dbal/src/Types/DateTimeTzType.php (2479B)
getDateTimeTzTypeDeclarationSQL($column);
}
/**
* {@inheritdoc}
*/
public function convertToDatabaseValue($value, AbstractPlatform $platform)
{
if ($value === null) {
return $value;
}
if ($value instanceof DateTimeInterface) {
return $value->format($platform->getDateTimeTzFormatString());
}
throw ConversionException::conversionFailedInvalidType(
$value,
$this->getName(),
['null', 'DateTime']
);
}
/**
* {@inheritdoc}
*/
public function convertToPHPValue($value, AbstractPlatform $platform)
{
if ($value === null || $value instanceof DateTimeInterface) {
return $value;
}
$val = DateTime::createFromFormat($platform->getDateTimeTzFormatString(), $value);
if ($val === false) {
throw ConversionException::conversionFailedFormat(
$value,
$this->getName(),
$platform->getDateTimeTzFormatString()
);
}
return $val;
}
}