示例#1
0
 /**
  * Update a record in the database.
  *
  * @param  array  $values
  * @return int
  */
 public function update(array $values)
 {
     $sql = $this->grammar->compileUpdate($this, $values);
     return $this->connection->update($sql, $this->cleanBindings($this->grammar->prepareBindingsForUpdate($this->bindings, $values)));
 }
示例#2
0
 /**
  * Prepare the bindings for an update statement.
  *
  * @param  array  $bindings
  * @param  array  $values
  * @return array
  */
 public function prepareBindingsForUpdate(array $bindings, array $values)
 {
     foreach ($values as $column => $value) {
         if ($this->isJsonSelector($column) && in_array(gettype($value), ['boolean', 'integer', 'double'])) {
             unset($values[$column]);
         }
     }
     return parent::prepareBindingsForUpdate($bindings, $values);
 }