You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got entity
User { private int $uId; .... }
and I'm trying to get data for this entity using:
(new UserModel())->join('usertablewithadditionaldata', 'user.uId = usertablewith....uid', 'left')->get()->getResult(\App\Entity\User);
but in that case uId field is null. should be null or it is an error?
The text was updated successfully, but these errors were encountered:
nowackipawel
changed the title
Joined field entity problem.
MySQL join / missing value for field which was used in join.
Apr 5, 2018
It looks like both tables have a uid column? In that case, it could be the table you're joining has an empty uid column that is overwriting the one from the user table.
When joining tables that might have column names in common, you should be explicit in what fields you want to pull, i.e. ->select('user.*') as part of your query.
I've got entity
User { private int $uId; .... }
and I'm trying to get data for this entity using:
(new UserModel())->join('usertablewithadditionaldata', 'user.uId = usertablewith....uid', 'left')->get()->getResult(\App\Entity\User);
but in that case uId field is null. should be null or it is an error?
The text was updated successfully, but these errors were encountered: