Welcome Guest, Not a member yet? Register   Sign In
Can a helper load a model?
#12

[eluser]ejangi[/eluser]
You "getRating()" method in the model is return an array of objects, yet in the helper you're trying to ask for properties of an array (which is impossible as an array is not an object in PHP, hence the error).

Try changing getRating() to this:
Code:
function getRating($id)
{
    $query = $this->db->getWhere("rating", array("id" => $id));
    $return = $query->result();
    return (isset($return[0])) ? $return[0] : 0;
}


Messages In This Thread
Can a helper load a model? - by El Forum - 02-12-2008, 10:09 PM
Can a helper load a model? - by El Forum - 02-12-2008, 10:15 PM
Can a helper load a model? - by El Forum - 02-12-2008, 10:21 PM
Can a helper load a model? - by El Forum - 02-12-2008, 10:25 PM
Can a helper load a model? - by El Forum - 02-12-2008, 11:00 PM
Can a helper load a model? - by El Forum - 02-12-2008, 11:09 PM
Can a helper load a model? - by El Forum - 02-12-2008, 11:12 PM
Can a helper load a model? - by El Forum - 02-12-2008, 11:13 PM
Can a helper load a model? - by El Forum - 02-12-2008, 11:17 PM
Can a helper load a model? - by El Forum - 02-12-2008, 11:22 PM
Can a helper load a model? - by El Forum - 02-12-2008, 11:25 PM
Can a helper load a model? - by El Forum - 02-12-2008, 11:41 PM
Can a helper load a model? - by El Forum - 02-13-2008, 12:53 AM
Can a helper load a model? - by El Forum - 02-13-2008, 06:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB