summaryrefslogtreecommitdiffstats
path: root/lib/public/WorkflowEngine/ICheck.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/WorkflowEngine/ICheck.php')
-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;
}