From 2bf5423974e8d3cf0babfd8f873058e487db2cbb Mon Sep 17 00:00:00 2001 From: yespire Date: Sat, 3 Jul 2021 22:54:31 -0700 Subject: [PATCH] PDOStatementProxy->setFetchMode() to match that of PDOStatement (#109) * PDOStatementProxy->setFetchMode() to match that of PDOStatement Co-authored-by: sy-records <52o@qq52o.cn> --- src/core/Database/PDOStatementProxy.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/core/Database/PDOStatementProxy.php b/src/core/Database/PDOStatementProxy.php index 0b2972b4..6fd8b822 100644 --- a/src/core/Database/PDOStatementProxy.php +++ b/src/core/Database/PDOStatementProxy.php @@ -123,13 +123,11 @@ public function setAttribute(int $attribute, $value): bool return $this->__object->setAttribute($attribute, $value); } - public function setFetchMode(int $mode, $classNameObject = null, array $ctorarfg = []): bool + public function setFetchMode(int $mode, ...$args): bool { - $this->setFetchModeContext = [$mode, $classNameObject, $ctorarfg]; - if (!isset($classNameObject)) { - return $this->__object->setFetchMode($mode); - } - return $this->__object->setFetchMode($mode, $classNameObject, $ctorarfg); + array_unshift($args, $mode); + $this->setFetchModeContext = $args; + return $this->__object->setFetchMode(...$args); } public function bindParam($parameter, &$variable, $data_type = PDO::PARAM_STR, $length = null, $driver_options = null): bool