Skip to content

Filters nested asso extended - #1

Merged
Seb33300 merged 13 commits into
Seb33300:filters-nested-assofrom
KDederichs:filters-nested-asso-extended
Jul 4, 2026
Merged

Filters nested asso extended#1
Seb33300 merged 13 commits into
Seb33300:filters-nested-assofrom
KDederichs:filters-nested-asso-extended

Conversation

@KDederichs

Copy link
Copy Markdown

Added tests for your changes.
At the same time I also imported my PRs and merged the newest 5.x branch and resolved the conflicts

Seb33300 and others added 6 commits March 12, 2026 22:54
# Conflicts:
#	config/services.php
#	src/Field/Configurator/AssociationConfigurator.php
#	src/Field/Configurator/CollectionConfigurator.php
#	src/Orm/EntityRepository.php
#	tests/Unit/Field/Configurator/AssociationConfiguratorTest.php
#	tests/Unit/Orm/EntityRepositoryTest.php
@Seb33300
Seb33300 force-pushed the filters-nested-asso branch from 1be57a5 to 6459419 Compare July 4, 2026 11:47
@Seb33300

Seb33300 commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Hi @KDederichs
Usually we do not merge the base branch. Instead we do a rebase.
I just rebased my branch to fetch all updates but now we have conflicts

Comment thread tests/Unit/Orm/EntityRepositoryTest.php Outdated
Comment thread tests/Unit/Orm/EntityRepositoryTest.php
@KDederichs
KDederichs requested a review from Seb33300 July 4, 2026 12:20
@KDederichs
KDederichs force-pushed the filters-nested-asso-extended branch from a5c2487 to 662033f Compare July 4, 2026 12:26
Comment thread tests/Unit/Orm/EntityRepositoryTest.php Outdated
Comment thread tests/Unit/Orm/EntityRepositoryTest.php Outdated
Comment thread tests/Unit/Orm/EntityRepositoryTest.php
Comment thread src/Filter/Configurator/EntityConfigurator.php Outdated
Comment thread tests/Unit/Orm/EntityRepositoryTest.php
@Seb33300

Seb33300 commented Jul 4, 2026

Copy link
Copy Markdown
Owner

No more comment on my side, Thanks!

@KDederichs

Copy link
Copy Markdown
Author

Nice, I committed the 2 small things you mentioned earlier

@Seb33300

Seb33300 commented Jul 4, 2026

Copy link
Copy Markdown
Owner

linter and phpstan checks are failing

@KDederichs

Copy link
Copy Markdown
Author

yup I saw, this should fix it I think, I don't have a local copy of the linter atm so I'm not sure about that one but the PHPStan errors are gone

@KDederichs

Copy link
Copy Markdown
Author

ok missed some linebreaks, should be good now

@Seb33300
Seb33300 merged commit cd00182 into Seb33300:filters-nested-asso Jul 4, 2026
16 checks passed
Seb33300 pushed a commit that referenced this pull request Jul 29, 2026
… (Seb33300, KDederichs)

This PR was merged into the 5.x branch.

Discussion
----------

Fix nested associations and embedded properties

Same as EasyCorp#7295 with a different approach.

Fixes EasyCorp#7452, EasyCorp#6664 and EasyCorp#7514

In `resolveNestedAssociations()` I have extracted the logic handling nested associations from search to make it reusable.
It also properly handles doctrine embeddables.

It's now possible to use associations in filters using the dot syntax:

```php
    public function configureFilters(Filters $filters): Filters
    {
        return $filters
            // author is an association
            ->add(TextFilter::new('author.fullName', 'Author name'))
            // address is an Embeddable
            ->add(TextFilter::new('author.address.country', 'Author country'));
    }
```

This PR also includes contributions from `@KDederichs` to reuse `resolveNestedAssociations()` and fix usage of nested associations in `AssociationField` and `CollectionField`

Commits
-------

9782078 Reset property name
469cec7 Fix field configurators
cd00182 Filters nested asso extended (#1)
6459419 Fix filters on nested associations and embedded properties
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.

2 participants