Closed allgrowsm closed 3 years ago
Have you checkted the generated SQL using the debugger, and run that SQL directly? Does that produce the data you expect?
It would be interesting to know if the problem is in the query generator, or in the hydration of the result.
@WanWizard
Thank you for reply :) The generated SQL query is okay. It joins the correct tables.
It seems like all loop has 1st loop data like following.
For example....
■1st loop result ABC 123 ■2nd loop result EFG 456
ABC 123 ■3d loop rsult HIJK 78910
EEEE 2929
ABC 123
I am talking about following source code.
// This fetches wrong related data.
$model =Model_User::gerUserRelatedData();
foreach($model as $m)
{
$a = array()
foreach($m->user_a as $user_a)
{
$a[] = $user_a;
}
$b = array();
foreach($m->user_b as $user_b)
{
$b[] = $user_b;
}
print_r($a);
print_r($b);
}
By the way, I already updated to the latest fuel as well.
The ORM result hydration has been refactored, could you check if this has also solved your problem?
@WanWizard Thank you very much for fixing this issue. I always appreviate it. I will check it out.
@WanWizard Sorry for late response. I have checked today and now it is working correctly. Thank you very much for reafactoring. I really appreciate it.
Now I close this issue.
Hello,
I found bug like ORM fetching wrong data.
I have following tables and ORM relation is has_many from users to user_A and user_B.
I also have following model. This is just an example of model.
When you execute above source code, you can see gerUserRelatedData() fetches wrong related data. On the other hand, gerUserRelatedOne() fetches correct data somehow.
Can you please take a look at orm?
Best regards,