Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2019-09-09 17:04:12 +0300
committerArthur Schiwon <blizzz@arthur-schiwon.de>2019-09-09 23:56:05 +0300
commit4cd931fcc6bb7f794fd14ddb75c7867823449e79 (patch)
tree0d2a6d1083dc865407cbe9cd891c977c0e4c9f06 /lib/public/WorkflowEngine
parentfd2de58503a3c915cf178385db3e9962845719c4 (diff)
require IChecks to receive entity context
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib/public/WorkflowEngine')
-rw-r--r--lib/public/WorkflowEngine/ICheck.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/public/WorkflowEngine/ICheck.php b/lib/public/WorkflowEngine/ICheck.php
index f5586e83d51..6e9c2fc765e 100644
--- a/lib/public/WorkflowEngine/ICheck.php
+++ b/lib/public/WorkflowEngine/ICheck.php
@@ -70,4 +70,24 @@ interface ICheck {
* @since 18.0.0
*/
public function isAvailableForScope(int $scope): bool;
+
+ /**
+ * Equips the check with a subject fitting the Entity. For instance, an
+ * entity of File will receive an instance of OCP\Files\Node, or a comment
+ * entity might get an IComment.
+ *
+ * The implementing check must be aware of the incoming type.
+ *
+ * If an unsupported subject is passed the implementation MAY throw an
+ * \UnexpectedValueException.
+ *
+ * When an implementation does not depend on a subject being passed to it,
+ * for example RequestTime, the implemented method SHOULD just pass, without
+ * any further operation.
+ *
+ * @param IEntity $entity
+ * @param mixed $subject
+ * @throws \UnexpectedValueException
+ */
+ public function setEntitySubject(IEntity $entity, $subject): void;
}