-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Improve association data fetching #9499
Copy link
Copy link
Closed
Labels
Milestone
Description
This is a ticket to track the many improvements we need to make on contain() and friends:
- Allow alias overriding for associations. (refs matching() multiple times on deep associations with aliased models only appears to JOIN the first alias #8448 and 3.0 Multiple contains with same name #5214) This is tricky, since folks would probably expect aliases in conditions to be automatically renamed. We could encourage using
$table->aliasField()as a way to help us minimise the risk of using the wrong alias. - The association path should be followed strictly when building the matching graph. This graph should not be hijacked by other associations. (refs Matching() works incorrectly in deep associations where two models have the same associated model #8662)
- More resilient joins nesting. I thought the logic around letting custom finders inject joins was sound, but it seems like it still has some rough edges (refs 3.2.3 ORM Allow nesting of innerJoin/with() and not/Matching() #8380)
- There should be a way to specify what fields in the junction tables should be selected. (refs Is there any way to limit the selected columns in a belongs to many join table? #6777)
Reactions are currently unavailable