Expliticly declare a conversion from the custom TinyInt doctrine type to int

This hopefully fixes issue #434
This commit is contained in:
Jan Böhmer 2023-11-19 21:03:43 +01:00
parent 5f87d5b1ac
commit de8a68c70d

View file

@ -41,6 +41,20 @@ class TinyIntType extends Type
return 'tinyint';
}
/**
* {@inheritDoc}
*
* @param T $value
*
* @return (T is null ? null : int)
*
* @template T
*/
public function convertToPHPValue($value, AbstractPlatform $platform)
{
return $value === null ? null : (int) $value;
}
public function requiresSQLCommentHint(AbstractPlatform $platform): bool
{
//We use the comment, so that doctrine migrations can properly detect, that nothing has changed and no migration is needed.