protected function setPdoForType(Connection $connection, $type = null)
    {
        if ($type == 'read') {
            $connection->setPdo($connection->getReadPdo());
        } else if ($type == 'write') {
            $connection->setReadPdo($connection->getPdo());
        }

        return $connection;
    }