public function getAncestors(Criteria $criteria = null, ConnectionInterface $con = null)
    {
        if ($this->isRoot()) {
            // save one query
            return array();
        } else {
            return ChildCategoryQuery::create(null, $criteria)
                ->ancestorsOf($this)
                ->orderByBranch()
                ->find($con);
        }
    }
public function getAncestors(Criteria $criteria = null, ConnectionInterface $con = null)
    {
        if ($this->isRoot()) {
            // save one query
            return array();
        } else {
            return ChildCategoryQuery::create(null, $criteria)
                ->ancestorsOf($this)
                ->orderByBranch()
                ->find($con);
        }
    }
public function getAncestors ( Criteria $ criteria = null , ConnectionInterface $ con = null ) { if ( $ this -> isRoot ( ) ) { // save one query return array ( ) ; } else { return ChildCategoryQuery :: create ( null , $ criteria ) -> ancestorsOf ( $ this ) -> orderByBranch ( ) -> find ( $ con ) ; } }
Gets ancestors for the given node, starting with the root node
Use it for breadcrumb paths for instance

@param      Criteria $criteria Criteria to filter results.
@param      ConnectionInterface $con Connection to use.
@return     ObjectCollection|ChildCategory[] List of ChildCategory objects
Gets ancestors for the given node starting with the root node Use it for breadcrumb paths for instance