public function merge($query, array $data)
    {
        $expression = "/(\\?)(?=(?:[^']|'[^']*')*$)/";
        $callback   = function () use (&$data) {
            if (!$data) {
                return '?';
            }

            return $this->quote(array_shift($data));
        };

        return preg_replace_callback($expression, $callback, $query);
    }
public function merge($query, array $data)
    {
        $expression = "/(\\?)(?=(?:[^']|'[^']*')*$)/";
        $callback   = function () use (&$data) {
            if (!$data) {
                return '?';
            }

            return $this->quote(array_shift($data));
        };

        return preg_replace_callback($expression, $callback, $query);
    }
public function merge ( $ query , array $ data ) { $ expression = "/(\\?)(?=(?:[^']|'[^']*')*$)/" ; $ callback = function ( ) use ( & $ data ) { if ( ! $ data ) { return '?' ; } return $ this -> quote ( array_shift ( $ data ) ) ; } ; return preg_replace_callback ( $ expression , $ callback , $ query ) ; }
Merge data into an SQL query with placeholders

@param string $query
@param array  $data
@return string
Merge data into an SQL query with placeholders