Closed
Description
Symfony version(s) affected
5.4
Description
Updated Doctrine 2.11 and tried to use the backed enums.
https://www.doctrine-project.org/2022/01/11/orm-2.11.html
There is a problem in the deserialization process, symfony doesn't recognize that the enum field 'type' is an enum and that the enum entity should be constructed with the passed integer.
When i remove the ORM annotation, the serialization process works as intended.
How to reproduce
Person.php -
#[ORM\Column(type: 'integer', enumType: Type::class)]
private Type $type,`
Type
<?php
declare(strict_types=1);
namespace App\Entity\Enum;
enum Type: int
{
case PARENT = 0;
case CHILD = 1;
}
Possible Solution
No response
Additional Context
Exception: App\Entity\Person::__construct(): Argument #2 ($type) must be of type App\Entity\Enum\Type, int given