I have Users -> hasMany -> Pupils -> hasMany -> EduHistories
I save them by associated Entity like below
$user = $this->Users->newEntity($userData, [ 'associated' => ['Pupils.EduHistories'] ]);
The Pupils saved OK with a correct ID, the EduHistories is also OK with correct ID of Pupils.
However, the Pupils always has user_id = 1, even the Users is saved, with no error, and ID is something else.
I am not assigning ID manually to any of them. They all new entities.
And I check associations in Models tables, they seem to be fine.
What could possibly wrong?
Thank you for your help.