getParams(); if (isset($params['portability'])) { $this->portability = $params['portability'] = (new OptimizeFlags())( $this->getDatabasePlatform(), $params['portability'] ); } if (isset($params['fetch_case']) && $this->portability & self::PORTABILITY_FIX_CASE) { if ($this->_conn instanceof PDOConnection) { // make use of c-level support for case handling $this->_conn->setAttribute(PDO::ATTR_CASE, $params['fetch_case']); } else { $this->case = $params['fetch_case'] === ColumnCase::LOWER ? CASE_LOWER : CASE_UPPER; } } } return $ret; } /** * @return int */ public function getPortability() { return $this->portability; } /** * @return int|null */ public function getFetchCase() { return $this->case; } /** * {@inheritdoc} */ public function executeQuery($sql, array $params = [], $types = [], ?QueryCacheProfile $qcp = null) { $stmt = new Statement(parent::executeQuery($sql, $params, $types, $qcp), $this); $stmt->setFetchMode($this->defaultFetchMode); return new ForwardCompatibility\Result($stmt); } /** * {@inheritdoc} * * @param string $sql * * @return Statement */ public function prepare($sql) { $stmt = new Statement(parent::prepare($sql), $this); $stmt->setFetchMode($this->defaultFetchMode); return $stmt; } /** * {@inheritdoc} */ public function query() { $connection = $this->getWrappedConnection(); $stmt = $connection->query(...func_get_args()); $stmt = new Statement($stmt, $this); $stmt->setFetchMode($this->defaultFetchMode); return $stmt; } }