Пример #1
0
 /**
  * @return \Fusio\Engine\Repository\ConnectionInterface
  */
 protected function createRepository()
 {
     $connection = new Connection();
     $connection->setId(1);
     $connection->setName('foo');
     $repository = new Repository\ConnectionMemory();
     $repository->add($connection);
     return $repository;
 }
Пример #2
0
 protected function getRepository()
 {
     $repository = $this->getConnectionRepository();
     $connection = new Connection();
     $connection->setId(1);
     $connection->setName('foo');
     $connection->setClass(CallbackConnection::class);
     $connection->setConfig(['callback' => function () {
         return new \stdClass();
     }]);
     $repository->add($connection);
     return $repository;
 }
Пример #3
0
 protected function newConnection(array $row)
 {
     $config = !empty($row['config']) ? ConnectionService::decryptConfig($row['config'], $this->secretKey) : [];
     $connection = new Connection();
     $connection->setId($row['id']);
     $connection->setName($row['name']);
     $connection->setClass($row['class']);
     $connection->setConfig($config);
     return $connection;
 }