From 0c6ef271a8ea1dd81ec4a8b23276fe32b51c6a76 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Thu, 12 May 2022 12:11:16 +0000 Subject: [PATCH] - Fixed lastInsertId (dn) and queryResult count --- src/Common/LdapObject.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Common/LdapObject.php b/src/Common/LdapObject.php index 813d260..2b4fd68 100644 --- a/src/Common/LdapObject.php +++ b/src/Common/LdapObject.php @@ -16,7 +16,7 @@ class LdapObject { public int $bufferedRows = 0; - public int $lastInsertId = 0; + public /*int*/ $lastInsertId = 0; public string $dn; @@ -166,7 +166,10 @@ class LdapObject { $this->throwLdapException(); } - $this->rowCount = 1; + if ($queryResult) { + $this->rowCount = (int)$queryResult; + $this->lastInsertId = $dn; + } return $this; } @@ -179,7 +182,7 @@ class LdapObject { $this->throwLdapException(); } - $this->rowCount = 1; + $this->rowCount = (int) $queryResult; return $this; } @@ -192,7 +195,7 @@ class LdapObject { $this->throwLdapException(); } - $this->rowCount = 1; + $this->rowCount = (int) $queryResult; return $this; }