-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HasManyThrough, fails to detect missing relation, when aquired by mapper->all() #68
Comments
I see. This may be a problem with the |
Can you verify that it works properly without using the |
(not certain) |
ok some protocode leaving out the with('vdrs') So the problem seems to be the eager loading fails. |
I am currently trying to create a test scenario to reproduce this issue. |
Great to hear. Reply if you have difficulties reproducing. |
There is definitely an issue with the |
This has been solved with the release of Spot v2. Due to poor architecture that will lead to invariable replication of code, this will not be solved in this version of Spot. |
My setup for HasManyThrough
Vessel_entity <-> xTable <-> Vdr_entity
I can get a list of vdrs like this
$all_vdrs= $mapper->all('Entity\Vdr_entity')->with('vessels');
relations should be loaded
Now i create a foreach-loop to iterate.Within this a access $one_vdr->vessels
foreach ($all_vdrs as $one_vdr){
$cnt= $one_vdr->vessels->count(); //return 0, even if one or more vessels are present
$one_ves= $one_vdr->vessels->first();// works ok if there is a relation in the crosstable. It fails otherwise. I have no way of checking (exception handling could be a possibility)
}
I have tried $mapper->get(Entity\Vdr_entity,array('id =>1'));
in this case i can actually use the count() method
The text was updated successfully, but these errors were encountered: