src/db/Grammar.class.php
public function compileUpdate(Builder $query) {
		$table = $this->wrap($query->from[0]);
	
		// Each one of the columns in the update statements needs to be wrapped in the
		// keyword identifiers, also a place-holder needs to be created for each of
		// the values in the list of bindings so we can make the sets statements.
		$columns = array();
	
		foreach ($query->updates as $key => $value) {
			$columns[] = $this->wrap($key).' = ?';
		}
	
		$columns = implode(', ', $columns);
	
		$joins = isset($query->joins) ? ' '.$this->compileJoins($query, $query->joins) : '';

		// Of course, update queries may also be constrained by where clauses so we'll
		// need to compile the where clauses and attach it to the query so only the
		// intended records are updated by the SQL statements we generate to run.
		$where = $this->compileWheres($query);
	
		$sql = trim("update {$table}{$joins} set {$columns} {$where}");
		
		if (isset($query->orders)) {
			$sql .= ' '.$this->compileOrders($query, $query->orders);
		}
		if (isset($query->limit)) {
			$sql .= ' '.$this->compileLimit($query, $query->limit);
		}
		
		return trim($sql);
	}
public function compileUpdate(Builder $query) {
		$table = $this->wrap($query->from[0]);
	
		// Each one of the columns in the update statements needs to be wrapped in the
		// keyword identifiers, also a place-holder needs to be created for each of
		// the values in the list of bindings so we can make the sets statements.
		$columns = array();
	
		foreach ($query->updates as $key => $value) {
			$columns[] = $this->wrap($key).' = ?';
		}
	
		$columns = implode(', ', $columns);
	
		$joins = isset($query->joins) ? ' '.$this->compileJoins($query, $query->joins) : '';

		// Of course, update queries may also be constrained by where clauses so we'll
		// need to compile the where clauses and attach it to the query so only the
		// intended records are updated by the SQL statements we generate to run.
		$where = $this->compileWheres($query);
	
		$sql = trim("update {$table}{$joins} set {$columns} {$where}");
		
		if (isset($query->orders)) {
			$sql .= ' '.$this->compileOrders($query, $query->orders);
		}
		if (isset($query->limit)) {
			$sql .= ' '.$this->compileLimit($query, $query->limit);
		}
		
		return trim($sql);
	}
Compile an update statement into SQL.

@param  Builder $query
@param  array  $values
@return string