diff --git a/CHANGELOG.md b/CHANGELOG.md index cfba419..c5aff5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ### Changelog +##### v1.9.3 ++ Updated `InsertStatement` class with: + - Added `$insertId` argument in `execute()` method + ##### v1.9.2 + Updated `Database` class with: - Fixed `$options` argument in `__construct()` method @@ -9,7 +13,7 @@ - Fixed all aggregates ##### v1.9.0 -+ Added `whereMany` method ++ Added `whereMany()` method + Updated `limit()` method > Contributed by [bmutinda](https://github.com/bmutinda) and [scheras](https://github.com/scheras). Thanks! @@ -37,7 +41,7 @@ + Updated `StatementContainer` class with: - Added `$table` argument in `delete()` method + Updated `WhereClause` class with: - - Fixed `orWhereLike()` + - Fixed `orWhereLike()` method ##### v1.7.2 + Updated `SelectStatement` class with: diff --git a/composer.json b/composer.json index 3f43be7..c577a9a 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "slim/pdo", "description": "PDO database library for Slim Framework", - "version": "1.9.2", + "version": "1.9.3", "type": "library", "keywords": ["pdo", "database", "slim", "framework"], "homepage": "https://github.com/FaaPz/Slim-PDO", diff --git a/src/PDO/Statement/InsertStatement.php b/src/PDO/Statement/InsertStatement.php index a8d6d77..faa0eeb 100644 --- a/src/PDO/Statement/InsertStatement.php +++ b/src/PDO/Statement/InsertStatement.php @@ -91,11 +91,15 @@ public function __toString() } /** + * @param bool $insertId + * * @return string */ - public function execute() + public function execute($insertId = true) { - parent::execute(); + if (!$insertId) { + return parent::execute(); + } return $this->dbh->lastInsertId(); } diff --git a/src/PDO/Statement/StatementContainer.php b/src/PDO/Statement/StatementContainer.php index 86b77b2..5459b89 100644 --- a/src/PDO/Statement/StatementContainer.php +++ b/src/PDO/Statement/StatementContainer.php @@ -379,6 +379,7 @@ public function orderBy($statement, $order = 'ASC') /** * @param $number + * @param null $end * * @return $this */