From 15be1597b80c3f094cdefcb6a273841d889c0f5a Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Thu, 1 Feb 2024 16:17:08 +0000 Subject: [PATCH] - Fixed a recurrent bug within deleteOne() method --- src/ConnectionAdapter.php | 2 +- src/Repository.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ConnectionAdapter.php b/src/ConnectionAdapter.php index c5f6180..bfd2ad7 100644 --- a/src/ConnectionAdapter.php +++ b/src/ConnectionAdapter.php @@ -33,7 +33,7 @@ class ConnectionAdapter $this->adapter = $this->instanciateAdapter($adapterName); } else { - throw new \InvalidArgumentException("Adapter not found within your configuration array."); + throw new \InvalidArgumentException(sprintf("Adapter not found within your configuration array. (%s)", json_encode($connection))); } $this->adapter->setup($connection); diff --git a/src/Repository.php b/src/Repository.php index 24f859e..7deb446 100644 --- a/src/Repository.php +++ b/src/Repository.php @@ -114,7 +114,7 @@ class Repository throw new Exception\EntityPrimaryKeyUnknown("A primary key value has to be defined to delete an item."); } - return (bool) $this->wherePrimaryKey($value, null)->deleteOne()->rowCount; + return (bool) $this->wherePrimaryKey($value, false)->deleteOne()->rowCount; } public function destroy(object $entity) : bool