How to use PropertyName and ClassName

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?

I found!

The association must be declared that way:

$this->belongsToMany('RecLanguages', [
    'joinTable' => 'sites_reclanguages',
    'className' => 'Languages',
    'propertyName' => 'Reclanguages'
]);

$this->belongsToMany('Vislanguages', [
	'joinTable' => 'sites_vislanguages',
    'className' => 'Languages',
    'propertyName' => 'Vislanguages'
]);

And the query will be:

$sites = $this->Sites->find()
         ->contain([
             'Reclanguages',
             'Vislanguages
        ])
        ->where([...])
        ->all();