I'm just a newbe in Kohana ORM, so my question may be a bit silly for pro's, but.. :)
I have some ORM models, and all of them have a few the same methods like:
public function items_order_by_id($reverse = false)
{
if($reverse) return $this->order_by($this->_primary_key, 'desc')->find_all();
else return $this->order_by($this->_primary_key, 'asc')->find_all();
}
OR
public function get_form()
{
$result = array();
foreach($this->_table_columns as $key => $value)
{
if($value['form']) $result[$key] = $this->_prefix.'_'.$key;
}
return $result;
}
If I'm adding a new model I must copy all similar methods, and If I want to modify any method I must modify all files. I know object programming has inheritance, but when I'm trying to extend Kohana_ORM I get exception for example:
The comment_id property does not exist in the Model_Comment class
And all another properities also do not exist.
Is it possible, to have a parent model which contain these methods?