summaryrefslogtreecommitdiffstats
path: root/vendor/ipl/orm/src/Contract/RewriteFilterBehavior.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ipl/orm/src/Contract/RewriteFilterBehavior.php')
-rw-r--r--vendor/ipl/orm/src/Contract/RewriteFilterBehavior.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/vendor/ipl/orm/src/Contract/RewriteFilterBehavior.php b/vendor/ipl/orm/src/Contract/RewriteFilterBehavior.php
new file mode 100644
index 0000000..af6de5b
--- /dev/null
+++ b/vendor/ipl/orm/src/Contract/RewriteFilterBehavior.php
@@ -0,0 +1,25 @@
+<?php
+
+namespace ipl\Orm\Contract;
+
+use ipl\Orm\Behavior;
+use ipl\Stdlib\Filter;
+
+interface RewriteFilterBehavior extends Behavior
+{
+ /**
+ * Rewrite the given filter condition
+ *
+ * The condition can either be adjusted directly or replaced by an entirely new rule. The result must be
+ * returned otherwise (NULL is returned) processing continues normally. (Isn't restarted)
+ *
+ * If a result is returned, it is required to append the given absolute path of the model to the column.
+ * Processing of the condition will be restarted, hence the column has to be an absolute path again.
+ *
+ * @param Filter\Condition $condition
+ * @param string $relation The absolute path (with a trailing dot) of the model
+ *
+ * @return Filter\Rule|null
+ */
+ public function rewriteCondition(Filter\Condition $condition, $relation = null);
+}