Description
Consider this:
- UsersTable->belongsTo('Contacts')
- ArticlesTable->belongsTo('Creator')->setClassName('Users')
- ArticleTable->belongsTo('Modifier')->setClassName('Users')
If we include Creator.Contacts and Modifier.Contacts in the same query the Contacts table will be joined once with the "Contacts" alias.
ie. the join is generated as JOIN contacts Contacts instead of Creator_Contacts or something like that.
Ideally the proper joins should be generated to support this, or at least only match one of the two associations in the resulting data.
CakePHP Version
5.2
PHP Version
No response