From 0870e3d22e451051ad21bc832cb68a0697bacb8d Mon Sep 17 00:00:00 2001 From: vershinin_so Date: Mon, 10 Feb 2020 16:48:43 +0300 Subject: [PATCH] access to connection through the getter --- src/Drivers/Pdo/Connection.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Drivers/Pdo/Connection.php b/src/Drivers/Pdo/Connection.php index 8733411e..61222612 100644 --- a/src/Drivers/Pdo/Connection.php +++ b/src/Drivers/Pdo/Connection.php @@ -20,7 +20,7 @@ public function query($query) { $this->ensureConnection(); - $statement = $this->connection->prepare($query); + $statement = $this->getConnection()->prepare($query); try { $statement->execute(); @@ -73,7 +73,7 @@ public function ping() { $this->ensureConnection(); - return $this->connection !== null; + return $this->getConnection() !== null; } /** @@ -88,7 +88,7 @@ public function multiQuery(array $queue) } try { - $statement = $this->connection->query(implode(';', $queue)); + $statement = $this->getConnection()->query(implode(';', $queue)); } catch (PDOException $exception) { throw new DatabaseException($exception->getMessage() .' [ '.implode(';', $queue).']', $exception->getCode(), $exception); } @@ -103,6 +103,6 @@ public function escape($value) { $this->ensureConnection(); - return $this->connection->quote($value); + return $this->getConnection()->quote($value); } }