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; }
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; }