/**
  * Compile an update statement into SQL.
  *
  * @param  \Database\Query\Builder  $query
  * @param  array  $values
  * @return string
  */
 public function compileUpdate(Builder $query, $values)
 {
     $sql = parent::compileUpdate($query, $values);
     if (isset($query->orders)) {
         $sql .= ' ' . $this->compileOrders($query, $query->orders);
     }
     if (isset($query->limit)) {
         $sql .= ' ' . $this->compileLimit($query, $query->limit);
     }
     return rtrim($sql);
 }
 /**
  * Update a record in the database.
  *
  * @param  array  $values
  * @return int
  */
 public function update(array $values)
 {
     $bindings = array_values(array_merge($values, $this->getBindings()));
     $sql = $this->grammar->compileUpdate($this, $values);
     return $this->connection->update($sql, $this->cleanBindings($bindings));
 }