Skip to content
New issue

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

How to register custom Hydration strategies? #732

Open
MatthiasKuehneEllerhold opened this issue Mar 7, 2023 · 1 comment
Open

How to register custom Hydration strategies? #732

MatthiasKuehneEllerhold opened this issue Mar 7, 2023 · 1 comment
Labels
Question Further information is requested

Comments

@MatthiasKuehneEllerhold
Copy link
Contributor

I'd like to use php8.1 built in enums in doctrine backed entities.
According to https://www.doctrine-project.org/projects/doctrine-laminas-hydrator/en/3.3/enum-strategy.html#using-enums-with-php-8-1 I need to create and register a custom hydration strategy for each enum I want to use.

Is there any configuration key where I can easily register them or do I have to use a Delegator on the DoctrineHydrator?

@driehle driehle added the Question Further information is requested label Apr 25, 2023
@driehle
Copy link
Member

driehle commented Apr 25, 2023

No, there is no specific configuration key, as currently there is no way to have hydrators being automatically created by DoctrineORMModule. Note that the hydrators are entity-specific anyways, as the properties for which you are registering the strategies will differ between different entities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants