/** * Generate the SQL statement for this query. * * @param array $parameters Out variable for parameters required for this query * @return string The completed SQL query */ public function sql(&$parameters = array()) { // Build each component as needed $sql = DB::build_sql($this, $parameters); if (empty($sql)) { return null; } if ($this->replacementsOld) { $sql = str_replace($this->replacementsOld, $this->replacementsNew, $sql); } return $sql; }
/** * Generate the SQL statement for this query. * * @param array $parameters Out variable for parameters required for this query * @return string The completed SQL query */ public function sql(&$parameters = array()) { if (func_num_args() == 0) { Deprecation::notice('3.2', 'SQLExpression::sql() now may produce parameters which are necessary to execute this query'); } // Build each component as needed $sql = DB::build_sql($this, $parameters); if (empty($sql)) { return null; } if ($this->replacementsOld) { $sql = str_replace($this->replacementsOld, $this->replacementsNew, $sql); } return $sql; }