Giacomo P. Wed Jul 28 15:49:24 -0400 2010

Subject: andling multiple finder results

How can I handle multiple finder results?
Can I do something like this?

$user = User::find(...)
echo $user0->name;
echo $user1->name;

Thank you

Kien La Fri Jul 30 14:02:15 -0400 2010

Yes, except you'll need to specify 'all' otherwise find returns only the first record instead of an array.

$user = User::find('all', ...);
echo $user[0]->name;
echo $user[1]->name;