aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework/Bootstrap
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2022-02-04 11:13:50 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2022-02-07 12:51:42 +0100
commit9a656e5b35d004b55fbe09d10d51254a8ec4fd67 (patch)
treeed1dd47a11822744820866ef2b5a5fc3e7dedeb9 /lib/private/AppFramework/Bootstrap
parentbb55b79837a677074473e980a6b88d358a118621 (diff)
downloadnextcloud-server-9a656e5b35d004b55fbe09d10d51254a8ec4fd67.tar.gz
nextcloud-server-9a656e5b35d004b55fbe09d10d51254a8ec4fd67.zip
Move calendar resource/room backend registration to IBootstrap
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/private/AppFramework/Bootstrap')
-rw-r--r--lib/private/AppFramework/Bootstrap/RegistrationContext.php52
1 files changed, 52 insertions, 0 deletions
diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
index 401a967c988..b40d3356d1a 100644
--- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php
+++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
@@ -30,6 +30,8 @@ declare(strict_types=1);
namespace OC\AppFramework\Bootstrap;
use Closure;
+use OCP\Calendar\Resource\IBackend as IResourceBackend;
+use OCP\Calendar\Room\IBackend as IRoomBackend;
use OCP\Talk\ITalkBackend;
use RuntimeException;
use function array_shift;
@@ -70,6 +72,12 @@ class RegistrationContext {
/** @var null|ServiceRegistration<ITalkBackend> */
private $talkBackendRegistration = null;
+ /** @var ServiceRegistration<IResourceBackend>[] */
+ private $calendarResourceBackendRegistrations = [];
+
+ /** @var ServiceRegistration<IRoomBackend>[] */
+ private $calendarRoomBackendRegistrations = [];
+
/** @var ServiceFactoryRegistration[] */
private $services = [];
@@ -271,6 +279,20 @@ class RegistrationContext {
$backend
);
}
+
+ public function registerCalendarResourceBackend(string $class): void {
+ $this->context->registerCalendarResourceBackend(
+ $this->appId,
+ $class
+ );
+ }
+
+ public function registerCalendarRoomBackend(string $class): void {
+ $this->context->registerCalendarRoomBackend(
+ $this->appId,
+ $class
+ );
+ }
};
}
@@ -376,6 +398,20 @@ class RegistrationContext {
$this->talkBackendRegistration = new ServiceRegistration($appId, $backend);
}
+ public function registerCalendarResourceBackend(string $appId, string $class) {
+ $this->calendarResourceBackendRegistrations[] = new ServiceRegistration(
+ $appId,
+ $class,
+ );
+ }
+
+ public function registerCalendarRoomBackend(string $appId, string $class) {
+ $this->calendarRoomBackendRegistrations[] = new ServiceRegistration(
+ $appId,
+ $class,
+ );
+ }
+
/**
* @param App[] $apps
*/
@@ -635,4 +671,20 @@ class RegistrationContext {
public function getTalkBackendRegistration(): ?ServiceRegistration {
return $this->talkBackendRegistration;
}
+
+ /**
+ * @return ServiceRegistration[]
+ * @psalm-return ServiceRegistration<IResourceBackend>[]
+ */
+ public function getCalendarResourceBackendRegistrations(): array {
+ return $this->calendarResourceBackendRegistrations;
+ }
+
+ /**
+ * @return ServiceRegistration[]
+ * @psalm-return ServiceRegistration<IRoomBackend>[]
+ */
+ public function getCalendarRoomBackendRegistrations(): array {
+ return $this->calendarRoomBackendRegistrations;
+ }
}