diff --git a/lib/Transport/TransportManager.php b/lib/Transport/TransportManager.php index 27a6cc2..95283d7 100644 --- a/lib/Transport/TransportManager.php +++ b/lib/Transport/TransportManager.php @@ -32,9 +32,6 @@ use OCA\DavPush\Events\RegisterTransportsEvent; use OCA\DavPush\PushTransports\WebPushTransport; class TransportManager { - /** - * @var Transport[] - */ private array $transports = []; public function __construct(IEventDispatcher $dispatcher) { @@ -53,8 +50,15 @@ class TransportManager { return $this->transports; } + /** + * @return Transport + */ + public function getTransport($id): ?Transport { + return $this->transports[$id]; + } + public function registerTransport(Transport $transport): self { - $this->transports[] = $transport; + $this->transports[$transport->getId()] = $transport; return $this; } } \ No newline at end of file