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

feat(doctrine): add new filter for filtering an entity using PHP backed enum, resolves #6506 #6547

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

mremi
Copy link
Contributor

@mremi mremi commented Aug 26, 2024

Q A
Branch? main
Tickets Closes #6506
License MIT
Doc PR api-platform/docs#...

Adding new Doctrine filter for filtering an entity using PHP backed enum

@mremi mremi force-pushed the feat-backed-enum branch 2 times, most recently from 61e86ce to ce4e62c Compare August 26, 2024 15:44
@mremi mremi changed the title feat(filter): add new Doctrine filter BackedEnumFilter for filtering … feat(doctrine): add new filter for filtering an entity using PHP backed enum, resolves #6506 Aug 26, 2024
@mremi mremi force-pushed the feat-backed-enum branch 3 times, most recently from 57cd113 to 69bca82 Compare August 27, 2024 08:14
@mremi
Copy link
Contributor Author

mremi commented Aug 27, 2024

Hi @soyuka , could you please review it?

src/Doctrine/Common/Filter/BackedEnumFilterTrait.php Outdated Show resolved Hide resolved
src/Doctrine/Common/Filter/BackedEnumFilterTrait.php Outdated Show resolved Hide resolved

// Doctrine ORM 2.x returns an array and Doctrine ORM 3.x returns a FieldMapping object
if ($fieldMapping instanceof FieldMapping) {
$fieldMapping = (array) $fieldMapping;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does main support ORM 2.x ? I think that we can add the code only for 3.x

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/Doctrine/Orm/Tests/Filter/BackedEnumFilterTest.php Outdated Show resolved Hide resolved
@soyuka soyuka merged commit cd2dbd0 into api-platform:main Aug 30, 2024
56 of 59 checks passed
@soyuka
Copy link
Member

soyuka commented Aug 30, 2024

thanks!

soyuka pushed a commit to soyuka/core that referenced this pull request Aug 30, 2024
soyuka added a commit that referenced this pull request Aug 30, 2024
…ed enum, resolves #6506 (#6547) (#6560)

Co-authored-by: Rémi Marseille <marseille.remi@gmail.com>
@mremi
Copy link
Contributor Author

mremi commented Aug 30, 2024

@soyuka when will be bumped the next release including it?

@dunglas
Copy link
Member

dunglas commented Aug 30, 2024

@mremi during the API Platform Conference! It will be part of API Platform 3.4 and 4.0.

@mremi
Copy link
Contributor Author

mremi commented Aug 30, 2024

@dunglas nice! Thank you

@soyuka
Copy link
Member

soyuka commented Sep 12, 2024

@mremi can you add a documentation for this?

@mremi
Copy link
Contributor Author

mremi commented Sep 13, 2024

@mremi can you add a documentation for this?
You mean here https://github.com/api-platform/docs/blob/3.3/core/filters.md ?

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

Successfully merging this pull request may close these issues.

Support for BackedEnumFilter
3 participants