public function getNodeById($id)
    {
        if (empty($this->nodes[$id])) {
            throw new \InvalidArgumentException("Invalid node primary key $id");
        }
        return $this->nodes[$id];
    }
public function getNodeById($id)
    {
        if (empty($this->nodes[$id])) {
            throw new \InvalidArgumentException("Invalid node primary key $id");
        }
        return $this->nodes[$id];
    }
public function getNodeById ( $ id ) { if ( empty ( $ this -> nodes [ $ id ] ) ) { throw new \ InvalidArgumentException ( "Invalid node primary key $id" ) ; } return $ this -> nodes [ $ id ] ; }
Returns a single node from the tree, identified by its ID.

@param int $id Node ID

@throws \InvalidArgumentException

@return Node
Returns a single node from the tree identified by its ID .