aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/Lib/PriorityTrait.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/lib/Lib/PriorityTrait.php')
-rw-r--r--apps/files_external/lib/Lib/PriorityTrait.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/apps/files_external/lib/Lib/PriorityTrait.php b/apps/files_external/lib/Lib/PriorityTrait.php
new file mode 100644
index 00000000000..fad2c07e58c
--- /dev/null
+++ b/apps/files_external/lib/Lib/PriorityTrait.php
@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+namespace OCA\Files_External\Lib;
+
+use OCA\Files_External\Service\BackendService;
+
+/**
+ * Trait to implement priority mechanics for a configuration class
+ */
+trait PriorityTrait {
+
+ /** @var int initial priority */
+ protected $priority = BackendService::PRIORITY_DEFAULT;
+
+ /**
+ * @return int
+ */
+ public function getPriority() {
+ return $this->priority;
+ }
+
+ /**
+ * @param int $priority
+ * @return self
+ */
+ public function setPriority($priority) {
+ $this->priority = $priority;
+ return $this;
+ }
+}