protected function createPdoStatement($query, $pdo = null)
    {
        if (is_null($pdo)) {
            $pdo = $this->getPdo();
        }

        $grammar = $this->getQueryGrammar();

        $query = preg_replace_callback('#\{(.*?)\}#', function ($matches) use ($grammar)
        {
            $value = $matches[1];

            return $grammar->wrap($value);

        }, $query);

        return $pdo->prepare($query);
    }
protected function createPdoStatement($query, $pdo = null)
    {
        if (is_null($pdo)) {
            $pdo = $this->getPdo();
        }

        $grammar = $this->getQueryGrammar();

        $query = preg_replace_callback('#\{(.*?)\}#', function ($matches) use ($grammar)
        {
            $value = $matches[1];

            return $grammar->wrap($value);

        }, $query);

        return $pdo->prepare($query);
    }
protected function createPdoStatement ( $ query , $ pdo = null ) { if ( is_null ( $ pdo ) ) { $ pdo = $ this -> getPdo ( ) ; } $ grammar = $ this -> getQueryGrammar ( ) ; $ query = preg_replace_callback ( '#\{(.*?)\}#' , function ( $ matches ) use ( $ grammar ) { $ value = $ matches [ 1 ] ; return $ grammar -> wrap ( $ value ) ; } , $ query ) ; return $ pdo -> prepare ( $ query ) ; }
Parse and wrap the variables from query, then return a propared PDO Statement instance.

@param  string  $query
@param  \PDO  $pdo
@return \PDOStatement
Parse and wrap the variables from query then return a propared PDO Statement instance .