I'm trying to make a loop inside a loop, and i kind of made it work, but i feel like there has to be a better way to do this, because i can do the same thing without the ORM.
Code:
function test()
{
$c = new Chain();
$c->get();
foreach($c as $chain)
{
echo "<h3>".$chain->nme."</h3>";
$r = new Restaurant();
$r->where('chain_id', $chain->id)->get();
foreach($r as $rest)
{
echo $rest->name."<br />";
}
}
}