Skip to content

Commit

Permalink
Merge pull request #10 from nikehin/dev
Browse files Browse the repository at this point in the history
Исправлена опечатка в upsert
  • Loading branch information
aak74 authored Dec 29, 2018
2 parents 4571e09 + 72b4ffe commit 6a96270
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Element/AbstractElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ public function upsert(array $filter, array $params)
"filter" => $filter,
));

$primaryKey = $item[$this->primaryKey] || $item[strtolower($this->primaryKey)];
if ($item && $primaryKey) {
$primaryKey = $this->primaryKey;
$hasPrimaryKey = $item[$primaryKey] || $item[strtolower($primaryKey)];
if ($item && $hasPrimaryKey) {
$this->update($primaryKey, $params);
return $primaryKey;
}
Expand Down

0 comments on commit 6a96270

Please sign in to comment.