protected function replaceParams($sql, array $params) {
		$i=0;
		return preg_replace_callback('/\?/', function() use(&$i, $params, $sql) {
			$rep = $params[$i++];
			if(!$rep instanceof Raw && !$rep instanceof static)
				return "'".addslashes($rep)."'";
			else
				return '?';
		}, $sql);
	}
protected function replaceParams($sql, array $params) {
		$i=0;
		return preg_replace_callback('/\?/', function() use(&$i, $params, $sql) {
			$rep = $params[$i++];
			if(!$rep instanceof Raw && !$rep instanceof static)
				return "'".addslashes($rep)."'";
			else
				return '?';
		}, $sql);
	}
protected function replaceParams ( $ sql , array $ params ) { $ i = 0 ; return preg_replace_callback ( '/\?/' , function ( ) use ( & $ i , $ params , $ sql ) { $ rep = $ params [ $ i ++ ] ; if ( ! $ rep instanceof Raw && ! $ rep instanceof static ) return "'" . addslashes ( $ rep ) . "'" ; else return '?' ; } , $ sql ) ; }
Replace parameters in a SQL query.
@param  string $sql
@param  array  $params
@return string
Replace parameters in a SQL query .