[eluser]makoto kuwata[/eluser]
Hi all,
I have a question about model class.
Is it possible to specify model class for $query->result() or $query->row()?
Normally, these methods returns stdClass object:
Code:
$query = $this->db->getwhere('posts', array('id'=>123));
$obj = $query->row();
var_export($obj); //=> $obj is an instance of stdClass
But I want to specify model class, like the following:
Code:
$query = $this->db->getwhere('posts', array('id'=>123));
$this->load->model('Post');
$obj = $query->row(Post);
var_export($obj); //=> $obj is an instance of Post class
Is it possible? Or any good idea?
--
regards,
makoto kuwata