public function getParentsForBreadcrumbs(
    $entity,
        &$parents = []
    )
    {
        array_push($parents, $entity);
        if ($entity->parent !== null) {
            $this->getParentsForBreadcrumbs($entity->parent, $parents);
        }
        return array_reverse($parents);
    }
public function getParentsForBreadcrumbs(
    $entity,
        &$parents = []
    )
    {
        array_push($parents, $entity);
        if ($entity->parent !== null) {
            $this->getParentsForBreadcrumbs($entity->parent, $parents);
        }
        return array_reverse($parents);
    }
public function getParentsForBreadcrumbs ( $ entity , & $ parents = [ ] ) { array_push ( $ parents , $ entity ) ; if ( $ entity -> parent !== null ) { $ this -> getParentsForBreadcrumbs ( $ entity -> parent , $ parents ) ; } return array_reverse ( $ parents ) ; }
Finds all parents of the entity
@param type $entity
@param array $parents
@return array
Finds all parents of the entity