How to find all the ancestors (not only direct parent) of a record with the following model:
class Model_Category extends ORM {
protected $_belongs_to = array(
'parent' => array('model' => 'Category', 'foreign_key' => 'category_id'),
);
protected $_has_many = array(
'children' => array('model' => 'Category', 'foreign_key' => 'category_id'),
);
$category->parent->find() is only giving the direct parent and even when trying to fetch the parent of the parent with a recursive function it throws Kohana_Exception: Method find() cannot be called on loaded objects.
This occurs so natural to me that I guess there must an easy way to do it - I'm not sure if it's me or the lack of documentation on ORM relations - halp!