mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Expliticly declare a conversion from the custom TinyInt doctrine type to int
This hopefully fixes issue #434
This commit is contained in:
parent
5f87d5b1ac
commit
de8a68c70d
1 changed files with 14 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue