public function createVertex($id = NULL, $returnDuplicate = false)
    {
        // no ID given
        if ($id === NULL) {
            $id = $this->getNextId();
        }
        if ($returnDuplicate && $this->vertices->hasVertexId($id)) {
            return $this->vertices->getVertexId($id);
        }

        return new Vertex($this, $id);
    }
public function createVertex($id = NULL, $returnDuplicate = false)
    {
        // no ID given
        if ($id === NULL) {
            $id = $this->getNextId();
        }
        if ($returnDuplicate && $this->vertices->hasVertexId($id)) {
            return $this->vertices->getVertexId($id);
        }

        return new Vertex($this, $id);
    }
public function createVertex ( $ id = NULL , $ returnDuplicate = false ) { // no ID given if ( $ id === NULL ) { $ id = $ this -> getNextId ( ) ; } if ( $ returnDuplicate && $ this -> vertices -> hasVertexId ( $ id ) ) { return $ this -> vertices -> getVertexId ( $ id ) ; } return new Vertex ( $ this , $ id ) ; }
create a new Vertex in the Graph

@param  int|NULL                 $id              new vertex ID to use (defaults to NULL: use next free numeric ID)
@param  boolean                  $returnDuplicate normal operation is to throw an exception if given id already exists. pass true to return original vertex instead
@return Vertex                   (chainable)
@throws InvalidArgumentException if given vertex $id is invalid
@throws OverflowException        if given vertex $id already exists and $returnDuplicate is not set
@uses Vertex::getId()
create a new Vertex in the Graph