diff --git a/src/Queries/Base.php b/src/Queries/Base.php index b05aae1..a2fc04b 100644 --- a/src/Queries/Base.php +++ b/src/Queries/Base.php @@ -49,8 +49,15 @@ abstract class Base implements IteratorAggregate * @param $clauses */ protected function __construct(Query $fluent, $clauses) - { - $this->currentFetchMode = defined('PDO::FETCH_DEFAULT') ? PDO::FETCH_DEFAULT : PDO::FETCH_BOTH; + { + if (defined('PDO::FETCH_DEFAULT')) { + $this->currentFetchMode = $fluent->getPdo()->getAttribute(PDO::FETCH_DEFAULT) ?? PDO::FETCH_DEFAULT; + } elseif (defined('PDO::ATTR_DEFAULT_FETCH_MODE')) { + $this->currentFetchMode = $fluent->getPdo()->getAttribute(PDO::ATTR_DEFAULT_FETCH_MODE) ?? PDO::ATTR_DEFAULT_FETCH_MODE; + } else { + $this->currentFetchMode = PDO::FETCH_BOTH; + } + $this->fluent = $fluent; $this->clauses = $clauses; $this->result = null; diff --git a/src/Queries/Common.php b/src/Queries/Common.php index fefd253..1ac86ee 100644 --- a/src/Queries/Common.php +++ b/src/Queries/Common.php @@ -49,7 +49,7 @@ abstract class Common extends Base protected $joins = []; /** @var bool - Disable adding undefined joins to query? */ - protected $isSmartJoinEnabled = true; + protected $isSmartJoinEnabled = false; /** * @param string $name