public function toCypher(ConnectionInterface $connection, IlluminateSchemaGrammar $grammar)
    {
        $statements = [];

        // Each type of command has a corresponding compiler function on the schema
        // grammar which is used to build the necessary SQL statements to build
        // the blueprint element, so we'll just call that compilers function.
        foreach ($this->commands as $command)
        {
            $method = 'compile'.ucfirst($command->name);

            if (method_exists($grammar, $method))
            {
                if ( ! is_null($cypher = $grammar->$method($this, $command, $connection)))
                {
                    $statements = array_merge($statements, (array) $cypher);
                }
            }
        }

        return $statements;
    }
public function toCypher(ConnectionInterface $connection, IlluminateSchemaGrammar $grammar)
    {
        $statements = [];

        // Each type of command has a corresponding compiler function on the schema
        // grammar which is used to build the necessary SQL statements to build
        // the blueprint element, so we'll just call that compilers function.
        foreach ($this->commands as $command)
        {
            $method = 'compile'.ucfirst($command->name);

            if (method_exists($grammar, $method))
            {
                if ( ! is_null($cypher = $grammar->$method($this, $command, $connection)))
                {
                    $statements = array_merge($statements, (array) $cypher);
                }
            }
        }

        return $statements;
    }
public function toCypher ( ConnectionInterface $ connection , IlluminateSchemaGrammar $ grammar ) { $ statements = [ ] ; // Each type of command has a corresponding compiler function on the schema // grammar which is used to build the necessary SQL statements to build // the blueprint element, so we'll just call that compilers function. foreach ( $ this -> commands as $ command ) { $ method = 'compile' . ucfirst ( $ command -> name ) ; if ( method_exists ( $ grammar , $ method ) ) { if ( ! is_null ( $ cypher = $ grammar -> $ method ( $ this , $ command , $ connection ) ) ) { $ statements = array_merge ( $ statements , ( array ) $ cypher ) ; } } } return $ statements ; }
Get the raw Cypher statements for the blueprint.

@param  \Illuminate\Database\ConnectionInterface  $connection
@param  \Illuminate\Database\Schema\Grammars\Grammar  $grammar
@return array
Get the raw Cypher statements for the blueprint .