Let's say in my model, I have a function that queries two separate tables. I need to pass the results back to my controller to display in my view.
I'm using MongoDB but it should be the same for any other DB. Normally this would work.
$files = $grid->find(array("username" => $profile_id,
"thumbnail" => array('$ne' => true)) );
$return files;
But, I need to go a step further and check to see if the user has a default photo selected.
$getCount = $grid->count(array("username" => $profile_id,
"default" => array('$ne' => true)) );
If I recall correctly, I would normally do ...
$return array($files, $getCount);
Doesn't work though.