[eluser]frist44[/eluser]
This maybe be a stupid question, but I'm going through a look and doing some calculations and I'm having trouble adding the final result to the object.
Code:
foreach ($parts as $part) {
$open = new Mo();
$open->select_sum('quantity')->where('ordertype', 'FG')->where('part_id', $part->id)->group_by('part_id')->get();
$part->open = $open->quantity;
//echo $part->open;
}
If I echo $open->quantity;, I get the result I'm after, but not from $part->open;. I'd like it to be part of the object, so when it's passed to the view, it's available for display.
What am I doing wrong?