public function asNode(Model $model)
    {
        $node = $this->client->makeNode();

        // If the key name of the model is 'id' we will need to set it properly with setId()
        // since setting it as a regular property with setProperty() won't cut it.
        if ($model->getKeyName() == 'id')
        {
            $node->setId($model->getKey());
        }

        // In this case the dev has chosen a different primary key
        // so we use it insetead.
        else
        {
            $node->setProperty($model->getKeyName(), $model->getKey());
        }

        return $node;
    }
public function asNode(Model $model)
    {
        $node = $this->client->makeNode();

        // If the key name of the model is 'id' we will need to set it properly with setId()
        // since setting it as a regular property with setProperty() won't cut it.
        if ($model->getKeyName() == 'id')
        {
            $node->setId($model->getKey());
        }

        // In this case the dev has chosen a different primary key
        // so we use it insetead.
        else
        {
            $node->setProperty($model->getKeyName(), $model->getKey());
        }

        return $node;
    }
public function asNode ( Model $ model ) { $ node = $ this -> client -> makeNode ( ) ; // If the key name of the model is 'id' we will need to set it properly with setId() // since setting it as a regular property with setProperty() won't cut it. if ( $ model -> getKeyName ( ) == 'id' ) { $ node -> setId ( $ model -> getKey ( ) ) ; } // In this case the dev has chosen a different primary key // so we use it insetead. else { $ node -> setProperty ( $ model -> getKeyName ( ) , $ model -> getKey ( ) ) ; } return $ node ; }
Convert a model to a Node object.

@param  \Vinelab\NeoEloquent\Eloquent\Model $model
@return \Everyman\Neo4j\Node
Convert a model to a Node object .