$this->hasOne('Users');
$this->belongsToMany('Users', [
'through' => 'Memberships'
]);
$this->hasMany('Memberships', [
'foreignKey' => 'profile_id',
]);
Asked
Active
Viewed 66 times
-1
1 Answers
0
By using a different alias for one of the associations, they must be unique as they are stored in one and the same collection/registry.
$this->hasOne('PrimaryUsers', [
'className' => 'Users',
]);
See also

ndm
- 59,784
- 9
- 71
- 110