Example #1
0
 /**
  * Returns an arbitrary connection to a system which was previously
  * configured by the user
  *
  * @param integer $connectionId
  * @return \Fusio\Engine\ConnectionInterface
  */
 public function getConnection($connectionId)
 {
     $connection = $this->repository->get($connectionId);
     if ($connection instanceof Model\ConnectionInterface) {
         $parameters = new Parameters($connection->getConfig());
         return $this->factory->factory($connection->getClass())->getConnection($parameters);
     } else {
         throw new RuntimeException('Could not found connection ' . $connectionId);
     }
 }