public function getEndPoints()
    {
        $endPoints = array();
        if (!$this->hasChildren()) {
            return $endPoints;
        }

        foreach ($this->_children as $child) {
            $value = $child->getValue();

            if (null === $value) {
                $endPoints[] = $this;
            } elseif ((null !== $value)
                && $child->hasChildren())
            {
                $childEndPoints = $child->getEndPoints();
                if (!empty($childEndPoints)) {
                    $endPoints = array_merge($endPoints, $childEndPoints);
                }
            } elseif ((null !== $value) && !$child->hasChildren()) {
                $endPoints[] = $child;
            }
        }

        return $endPoints;
    }
public function getEndPoints()
    {
        $endPoints = array();
        if (!$this->hasChildren()) {
            return $endPoints;
        }

        foreach ($this->_children as $child) {
            $value = $child->getValue();

            if (null === $value) {
                $endPoints[] = $this;
            } elseif ((null !== $value)
                && $child->hasChildren())
            {
                $childEndPoints = $child->getEndPoints();
                if (!empty($childEndPoints)) {
                    $endPoints = array_merge($endPoints, $childEndPoints);
                }
            } elseif ((null !== $value) && !$child->hasChildren()) {
                $endPoints[] = $child;
            }
        }

        return $endPoints;
    }
public function getEndPoints ( ) { $ endPoints = array ( ) ; if ( ! $ this -> hasChildren ( ) ) { return $ endPoints ; } foreach ( $ this -> _children as $ child ) { $ value = $ child -> getValue ( ) ; if ( null === $ value ) { $ endPoints [ ] = $ this ; } elseif ( ( null !== $ value ) && $ child -> hasChildren ( ) ) { $ childEndPoints = $ child -> getEndPoints ( ) ; if ( ! empty ( $ childEndPoints ) ) { $ endPoints = array_merge ( $ endPoints , $ childEndPoints ) ; } } elseif ( ( null !== $ value ) && ! $ child -> hasChildren ( ) ) { $ endPoints [ ] = $ child ; } } return $ endPoints ; }
Retrieve the bottommost nodes of this node's tree

Retrieves the bottommost nodes of the tree by recursively calling
getEndPoints() on all children. If a child is null, it returns the parent
as an end point.

@return array
Retrieve the bottommost nodes of this node s tree