public function add_node(node $node) {
        $name = $node->name;
        if (isset($this->nodes[$name])) {
            throw new \coding_exception("Node name $name already used");
        }
        $this->nodes[$node->name] = $node;
    }
public function add_node(node $node) {
        $name = $node->name;
        if (isset($this->nodes[$name])) {
            throw new \coding_exception("Node name $name already used");
        }
        $this->nodes[$node->name] = $node;
    }
public function add_node ( node $ node ) { $ name = $ node -> name ; if ( isset ( $ this -> nodes [ $ name ] ) ) { throw new \ coding_exception ( "Node name $name already used" ) ; } $ this -> nodes [ $ node -> name ] = $ node ; }
Add a node to the tree.

@param node $node node object.

@throws \coding_exception
Add a node to the tree .