aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/Group/Backend/ICreateNamedGroupBackend.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/Group/Backend/ICreateNamedGroupBackend.php')
-rw-r--r--lib/public/Group/Backend/ICreateNamedGroupBackend.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/public/Group/Backend/ICreateNamedGroupBackend.php b/lib/public/Group/Backend/ICreateNamedGroupBackend.php
new file mode 100644
index 00000000000..25cef4f8687
--- /dev/null
+++ b/lib/public/Group/Backend/ICreateNamedGroupBackend.php
@@ -0,0 +1,26 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OCP\Group\Backend;
+
+/**
+ * @since 30.0.0
+ */
+interface ICreateNamedGroupBackend {
+ /**
+ * Tries to create a group from its name.
+ *
+ * If group name already exists, null is returned.
+ * Otherwise, new group ID is returned.
+ *
+ * @param string $name Group name
+ * @return ?string Group ID in case of success, null in case of failure
+ * @since 30.0.0
+ */
+ public function createGroup(string $name): ?string;
+}