Skip to content

Commit

Permalink
fix MySqlGrammar prepareBindingsForUpdate method
Browse files Browse the repository at this point in the history
  • Loading branch information
litvinchuk committed Nov 11, 2016
1 parent 5ed376c commit 2bb3669
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/Illuminate/Database/Query/Grammars/MySqlGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,14 @@ protected function compileJsonUpdateColumn($key, JsonExpression $value)
*/
public function prepareBindingsForUpdate(array $bindings, array $values)
{
$preparedBindings = parent::prepareBindingsForUpdate($bindings, $values);

$index = 0;

foreach ($values as $column => $value) {
if ($this->isJsonSelector($column) &&
in_array(gettype($value), ['boolean', 'integer', 'double'])) {
unset($preparedBindings[$index]);
unset($values[$column]);
}

$index++;
}

return $preparedBindings;
return parent::prepareBindingsForUpdate($bindings, $values);
}

/**
Expand Down

0 comments on commit 2bb3669

Please sign in to comment.