From 1a855777a1136ac41866d0c1ff1368ade696acdd Mon Sep 17 00:00:00 2001 From: Tomas Date: Tue, 24 Aug 2021 09:36:16 +0300 Subject: [PATCH] Resolve `executeUpdate` deprecation --- src/Query.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Query.php b/src/Query.php index a614067..8ed53b7 100644 --- a/src/Query.php +++ b/src/Query.php @@ -23,6 +23,10 @@ public function execute(string $table, array $dataset, array $types = []): int $sql = sql($this->connection->getDatabasePlatform(), new Identifier($table), $dataset); + if (method_exists($this->connection, 'executeStatement')) { + return $this->connection->executeStatement($sql, parameters($dataset), types($types, count($dataset))); + } + return $this->connection->executeUpdate($sql, parameters($dataset), types($types, count($dataset))); }