From 1985e0e8406a56140f387bc9bec786b419cbeccc Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 28 Jan 2022 01:49:44 +0400 Subject: [PATCH] Fix undefined class constant issue (#327) Co-authored-by: Aleksandr Milenin --- src/Queries/Base.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Queries/Base.php b/src/Queries/Base.php index 8b9e778..b05aae1 100644 --- a/src/Queries/Base.php +++ b/src/Queries/Base.php @@ -40,7 +40,7 @@ abstract class Base implements IteratorAggregate protected $message = ''; /** @var int */ - protected $currentFetchMode = PDO::FETCH_DEFAULT; + protected $currentFetchMode; /** * BaseQuery constructor. @@ -50,6 +50,7 @@ abstract class Base implements IteratorAggregate */ protected function __construct(Query $fluent, $clauses) { + $this->currentFetchMode = defined('PDO::FETCH_DEFAULT') ? PDO::FETCH_DEFAULT : PDO::FETCH_BOTH; $this->fluent = $fluent; $this->clauses = $clauses; $this->result = null;