added increment method to query builder.
This commit is contained in:
@@ -581,6 +581,18 @@ class Query {
|
||||
return (int) $this->connection->pdo->lastInsertId($sequence);
|
||||
}
|
||||
|
||||
/**
|
||||
* Increment the value of a column by a given amount.
|
||||
*
|
||||
* @param string $column
|
||||
* @param int $amount
|
||||
* @return int
|
||||
*/
|
||||
public function increment($column, $amount = 1)
|
||||
{
|
||||
return $this->update(array($column => Manager::raw($this->grammar->wrap($column).' + '.$amount)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an array of values in the database table.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user