Hello,
I want my SitesTable
be associated to Languages
with 2 kind of associations:
A site can speak several languages at deck and can speak several languages for the visits.
So I created 2 join tables sites_reclanguages
and sites_vislanguages
And so in SitesTable
I wrote the following associations:
$this->belongsToMany('Reclanguages', [
'joinTable' => 'sites_reclanguages',
'className' => 'Languages'
]);
$this->belongsToMany('Vislanguages', [
'joinTable' => 'sites_vislanguages',
'className' => 'Languages'
]);
And I expected to be able to write:
$sites = $this->Sites->find()
->contain([
'Reclanguages',
'Vislanguages
])
->where([...])
->all();
But it seems not to be the right way.
How to do it?