code: public function getConnection($connectionName, $forceFromMaster = true)
      {
          /*if($forceFromMaster) {
              return $this->buildConnection($this->connectionsConfig[$connectionName]);
          }*/
          //FIXME : check forceFromMaster parameter
          if (false === isset($this->connections[$connectionName])) {
              if (false === isset($this->connectionsConfig[$connectionName])) {
                  throw new \InvalidArgumentException("Connection \"$connectionName\" is not configured");
              }
              $this->connections[$connectionName] = $this->buildConnection($this->connectionsConfig[$connectionName]);
          }
  
          return $this->connections[$connectionName];
      }
docs: Get connection
  @param string $connectionName
  @param bool   $forceFromMaster
  @return \Doctrine\DBAL\Connection