public function getSize()
    {
        $size = 1;
        foreach ($this->getChildren() as $child) {
            $size += $child->getSize();
        }

        return $size;
    }
public function getSize()
    {
        $size = 1;
        foreach ($this->getChildren() as $child) {
            $size += $child->getSize();
        }

        return $size;
    }
public function getSize ( ) { $ size = 1 ; foreach ( $ this -> getChildren ( ) as $ child ) { $ size += $ child -> getSize ( ) ; } return $ size ; }
Return the number of nodes in a tree
@return int
Return the number of nodes in a tree