public function convertToDatabaseValue($value, AbstractPlatform
$platform) { if (!
$value instanceof DateTimeInterface && !
empty($value)) { trigger_error('Deprecated the implicit conversion of strings to DateTime objects in Doctrine entities, it will be removed in Shopware 5.7. Relying on this conversion will throw a deprecation warning till then, please only insert DateTime objects.', E_USER_DEPRECATED
);
$value =
new DateTime($value);
} elseif (empty($value)) { $value = null;
} return ($value !== null
) ?
$value->
format($platform->
getDateTimeFormatString()) : null;
} public function convertToPHPValue($value, AbstractPlatform
$platform) { if ($value === null
) { return null;
} $val = DateTime::
createFromFormat($platform->
getDateTimeFormatString(),
$value);
if (!
$val) { throw ConversionException::
conversionFailedFormat($value,
$this->
getName(),
$platform->
getDateTimeFormatString());
}