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 have a table exchanges that has standard_parcel_id and return_parcel_id. I want my Parcel model have an Exchange, so my relationship would be:
public function exchange(){
return $this->hasOne(Exchange::class, ['standard_parcel_id', 'return_parcel_id'], ['id', 'id']);
}
In this case no parcel finds its exchanges table record. If I use only one 'id', it will work for the first foreign key, but not for the second one. So in this case:
public function exchange(){
return $this->hasOne(Exchange::class, ['standard_parcel_id', 'return_parcel_id'], ['id']);
}
standard parcels find their Exchange, but return parcels do not.
Is there a workaround here?
The text was updated successfully, but these errors were encountered:
I have a table exchanges that has standard_parcel_id and return_parcel_id. I want my Parcel model have an Exchange, so my relationship would be:
In this case no parcel finds its exchanges table record. If I use only one 'id', it will work for the first foreign key, but not for the second one. So in this case:
standard parcels find their Exchange, but return parcels do not.
Is there a workaround here?
The text was updated successfully, but these errors were encountered: