Fatal error: Call to a member function result() on a non-object
My model is this:
class EmailTypes_model extends Base_module_model {
function __construct()
{
parent::__construct('email_types');
}
function get($id) {
$query = $this->db->get_where('email_types', array('id'=>$id));
return $query->row_array();
}
}
Which works fine when I access it from public facing controller. But then when I try to update a record via the fuelCMS admin it throws this error:
Fatal error: Call to a member function result() on a non-object in /Users/ben/Documents/htdocs/hp/hp-cxo-dcp/fuel/modules/fuel/core/MY_Model.php on line 675
What am I missing?
Thanks!
Comments
public $record_class = 'EmailType';
And make sure to add a record class below your EmailTypes_model class:
class EmailType_model extends Base_module_record { }
What may be happening is that FUEL is not finding a record class for you model and so it will return an array instead.