We have a CMS written in Kohana 2.3.x (yes, we know it is an old one). When I use the query builder like this:
$obj = ORM::factory('product')->where(array_of_wheres)->find_all()
than the $obj
will be an ORM_Iterator
.
But when I write something like this:
$obj = ORM::factory('product');
if($something)
$obj->where(array_of_wheres);
else
$obj->where(array_of_other_wheres);
$obj->find_all();
Than the $obj
will be a Product_Model
instead of ORM_Iterator
.
Can someone explain why is this happening?
Thanks, Dave.