Пример #1
0
 /**
  * Decrement a column's value by a given amount.
  *
  * @param  string  $column
  * @param  int     $amount
  * @param  array   $extra
  * @return int
  */
 public function decrement($column, $amount = 1, array $extra = [])
 {
     if (!is_numeric($amount)) {
         throw new InvalidArgumentException('Non-numeric value passed to decrement method.');
     }
     $wrapped = $this->grammar->wrap($column);
     $columns = array_merge([$column => $this->raw("{$wrapped} - {$amount}")], $extra);
     return $this->update($columns);
 }
Пример #2
0
 /**
  * Decrement a column's value by a given amount.
  *
  * @param  string  $column
  * @param  int     $amount
  * @param  array   $extra
  * @return int
  */
 public function decrement($column, $amount = 1, array $extra = [])
 {
     $wrapped = $this->grammar->wrap($column);
     $columns = array_merge([$column => $this->raw("{$wrapped} - {$amount}")], $extra);
     return $this->update($columns);
 }
Пример #3
0
 /**
  * Decrement a column's value by a given amount.
  *
  * @param  string  $column
  * @param  int     $amount
  * @return int
  */
 public function decrement($column, $amount = 1)
 {
     $wrapped = $this->grammar->wrap($column);
     return $this->update(array($column => $this->raw("{$wrapped} - {$amount}")));
 }