Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Queries update
Browse files Browse the repository at this point in the history
  • Loading branch information
furqansiddiqui committed Feb 24, 2018
1 parent 15b7790 commit 1c08d83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/ORM/Model/Lock.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function obtain(?string $crosscheckCol = null, $value = null): self
);

try {
$fetch = $table->db()->fetch($query, $this->matchValue);
$fetch = $table->db()->fetch($query, [$this->matchValue]);
} catch (DatabaseException $e) {
throw new ModelLockException($e->getMessage());
}
Expand Down
8 changes: 4 additions & 4 deletions src/ORM/Model/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public function save(?callable $callback = null): bool


try {
$table->db()->exec($query, ...$this->changes);
$table->db()->exec($query, $this->changes);
} catch (DatabaseException $e) {
throw ModelQueryException::QueryFailed("save", $table->_name);
}
Expand Down Expand Up @@ -222,7 +222,7 @@ public function insert(?callable $callback = null): bool
);

try {
$table->db()->exec($query, ...$this->changes);
$table->db()->exec($query, $this->changes);
} catch (DatabaseException $e) {
throw ModelQueryException::QueryFailed("insert", $table->_name);
}
Expand Down Expand Up @@ -268,7 +268,7 @@ public function update(?callable $callback = null): bool
);

try {
$table->db()->exec($query, ...$updateValues);
$table->db()->exec($query, $updateValues);
} catch (DatabaseException $e) {
throw ModelQueryException::QueryFailed("update", $table->_name);
}
Expand Down Expand Up @@ -296,7 +296,7 @@ public function delete(?callable $callback = null): bool
$query = sprintf('DELETE' . ' FROM `%s` WHERE `%s`=?', $table->_name, $this->matchColumn);

try {
$table->db()->exec($query, $this->matchValue);
$table->db()->exec($query, [$this->matchValue]);
} catch (DatabaseException $e) {
throw ModelQueryException::QueryFailed("delete", $table->_name);
}
Expand Down

0 comments on commit 1c08d83

Please sign in to comment.