Skip to content
This repository was archived by the owner on Aug 19, 2022. It is now read-only.

Commit 7bc5935

Browse files
committed
Updated to 1.1.5 version
1 parent b8c04a0 commit 7bc5935

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## 1.1.5 - 2017-07-03
4+
5+
* Bug fix in replace method.
6+
37
## 1.1.4 - 2017-05-16
48

59
* Added `Eliasis\Model\Model->_getDatabaseInstance` method.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "josantonius/database",
3-
"version": "1.1.4",
3+
"version": "1.1.5",
44
"type": "library",
55
"description": "Library for SQL database management to be used by several providers at the same time.",
66
"keywords": [

src/Database.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,4 +906,4 @@ public function __destruct() {
906906

907907
$this->_provider->kill();
908908
}
909-
}
909+
}

src/Provider/PDOprovider.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,19 @@ public function replace($table, $data, $statements) {
378378

379379
$columnIdName = $columns[0];
380380

381-
$id = array_shift($data);
381+
if ($statements && isset($statements[0][1])) {
382+
383+
$id = $statements[0][1];
384+
385+
} else {
386+
387+
$id = array_shift($data);
388+
}
382389

383390
$where = $columnIdName . ' = ' . $id;
384391

385392
$result = $this->select(
393+
386394
$columns, $table, $where, null, 1, $statements
387395
);
388396

0 commit comments

Comments
 (0)