public function compileInsert(Builder $query, array $values)
    {
        /**
         *  Essentially we will force every insert to be treated as a batch insert which
         * simply makes creating the Cypher easier for us since we can utilize the same
         * basic routine regardless of an amount of records given to us to insert.
         *
         * We are working on getting a Cypher like this:
         * CREATE (:Wiz {fiz: 'foo', biz: 'boo'}). (:Wiz {fiz: 'morefoo', biz: 'moreboo'})
         */

        if ( ! is_array($query->from))
        {
            $query->from = array($query->from);
        }

        $label = $this->prepareLabels($query->from);

        if ( ! is_array(reset($values)))
        {
            $values = array($values);
        }

        // Prepare the values to be sent into the entities factory as
        // ['label' => ':Wiz', 'bindings' => ['fiz' => 'foo', 'biz' => 'boo']]
        $values = array_map(function($entity) use($label)
        {
            return ['label' => $label, 'bindings' => $entity];
        }, $values);
        // We need to build a list of parameter place-holders of values that are bound to the query.
        return "CREATE ". $this->prepareEntities($values);
    }
public function compileInsert(Builder $query, array $values)
    {
        /**
         *  Essentially we will force every insert to be treated as a batch insert which
         * simply makes creating the Cypher easier for us since we can utilize the same
         * basic routine regardless of an amount of records given to us to insert.
         *
         * We are working on getting a Cypher like this:
         * CREATE (:Wiz {fiz: 'foo', biz: 'boo'}). (:Wiz {fiz: 'morefoo', biz: 'moreboo'})
         */

        if ( ! is_array($query->from))
        {
            $query->from = array($query->from);
        }

        $label = $this->prepareLabels($query->from);

        if ( ! is_array(reset($values)))
        {
            $values = array($values);
        }

        // Prepare the values to be sent into the entities factory as
        // ['label' => ':Wiz', 'bindings' => ['fiz' => 'foo', 'biz' => 'boo']]
        $values = array_map(function($entity) use($label)
        {
            return ['label' => $label, 'bindings' => $entity];
        }, $values);
        // We need to build a list of parameter place-holders of values that are bound to the query.
        return "CREATE ". $this->prepareEntities($values);
    }
public function compileInsert ( Builder $ query , array $ values ) { /**
         *  Essentially we will force every insert to be treated as a batch insert which
         * simply makes creating the Cypher easier for us since we can utilize the same
         * basic routine regardless of an amount of records given to us to insert.
         *
         * We are working on getting a Cypher like this:
         * CREATE (:Wiz {fiz: 'foo', biz: 'boo'}). (:Wiz {fiz: 'morefoo', biz: 'moreboo'})
         */ if ( ! is_array ( $ query -> from ) ) { $ query -> from = array ( $ query -> from ) ; } $ label = $ this -> prepareLabels ( $ query -> from ) ; if ( ! is_array ( reset ( $ values ) ) ) { $ values = array ( $ values ) ; } // Prepare the values to be sent into the entities factory as // ['label' => ':Wiz', 'bindings' => ['fiz' => 'foo', 'biz' => 'boo']] $ values = array_map ( function ( $ entity ) use ( $ label ) { return [ 'label' => $ label , 'bindings' => $ entity ] ; } , $ values ) ; // We need to build a list of parameter place-holders of values that are bound to the query. return "CREATE " . $ this -> prepareEntities ( $ values ) ; }
Compile an insert statement into Cypher.

@param  \Illuminate\Database\Query\Builder  $query
@param  array  $values
@return string
Compile an insert statement into Cypher .