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

Filter by Embedded Doctrine Type #4245

Closed
wizhippo opened this issue Mar 11, 2021 · 5 comments
Closed

Filter by Embedded Doctrine Type #4245

wizhippo opened this issue Mar 11, 2021 · 5 comments

Comments

@wizhippo
Copy link
Contributor

Add the ability to filter by an embedded Doctrine type

    /**
     *
     * @ORM\Embedded(class="Address", columnPrefix="p")
     *
     * @var \App\Entity\Address
     */
    private $primaryAddress;
$filters
            ->add('primaryAddress.address1')
@elvismdev
Copy link

@wizhippo Were you able to accomplish this somehow?

@wizhippo
Copy link
Contributor Author

I used https://gist.github.com/wizhippo/5c6f2c6fd56f81283387d357fcd2a918 in the end. It only works on a per field level. For example

        $filters->add(EmbeddedEntityPropertyFilter::new('primaryAddress:province'))

@elvismdev
Copy link

@wizhippo Beautiful! I'm definitely giving it a try in my project. I have the exact same use case as you, filtering by provinces, municipalities, etc.

@Ang3
Copy link
Contributor

Ang3 commented Dec 23, 2021

#4882

@javiereguiluz
Copy link
Collaborator

This issue has been automatically closed as part of our end-of-year repository maintenance. As an open-source project with limited resources, we need to focus our efforts on the most current and impactful issues. If this feature or bug is still relevant to you, please create a new issue. For bugs, include a detailed reproducer, and for features, provide a clear explanation of your request. Thank you for your understanding and for supporting our project!

@EasyCorp EasyCorp locked and limited conversation to collaborators Dec 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants