/** * @param string $name * @return Connection */ protected function makeConnection($name) { $connection = parent::makeConnection($name); if (!$connection instanceof Connection) { return $connection; } $pdo = $connection->getPdo(); $wrapper = null; if ($pdo instanceof PDO && ($wrapper = $this->attrOrWrap($pdo))) { $connection->setPdo($wrapper); } $readPdo = $connection->getReadPdo(); if ($readPdo instanceof PDO) { if ($readPdo !== $pdo) { $wrapper = $this->attrOrWrap($readPdo); } if ($wrapper) { $connection->setReadPdo($wrapper); } } return $connection; }