We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After upgraded to the latest version, we are having trouble hydrating entities containing an enum, after a DQL query
App\Entity\Enum\ArticleState::from(): Argument #1 ($value) must be of type string, App\Entity\Enum\ArticleState given
class Article { #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255, enumType: ArticleState::class)] private ?ArticleState $state = null; public function getId(): ?int { return $this->id; } public function setName(string $name): self { $this->name = $name; return $this; } public function getState(): ?ArticleState { return $this->state; } public function setState(ArticleState $state): self { $this->state = $state; return $this; } }
enum ArticleState: string { case ONLINE = 'online'; case OFFLINE = 'offline'; }
/** * @return Article[] */ public function findByState(ArticleState $articleState): array { return $this->createQueryBuilder('a') ->andWhere('a.state = :state') ->setParameter('state', $articleState->value) ->getQuery() ->getResult(); }
https://github.com/bastien70/enum-reproducer
EDIT : duplicate of #10058
The text was updated successfully, but these errors were encountered:
No branches or pull requests
BC Break Report
Summary
After upgraded to the latest version, we are having trouble hydrating entities containing an enum, after a DQL query
Current behavior
How to reproduce
Reproducer
https://github.com/bastien70/enum-reproducer
EDIT : duplicate of #10058
The text was updated successfully, but these errors were encountered: