[eluser]RIVO10[/eluser]
Hello, i'm starting with IgnitedRecord and ometimes i need to get a plain object from the query.
I added that function to te IR_Record class (model/ignitedrecord/record.php)
Code:
function plain()
{
$obj = $this;
unset($obj->__table);
unset($obj->__id);
unset($obj->__data);
unset($obj->__instance);
return (Object) $obj;
}
And later, using the query normally, adding the call to the function at the end:
Code:
//This line saves the plain result in the session, in the product model.
$this->session->set_userdata('product', $this->find('51')->plain() );
I think it could be useful to someone, but maybe this is not the best way to do it...