aboutsummaryrefslogtreecommitdiff
path: root/src/Search/FTSNotExpr.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Search/FTSNotExpr.php')
-rw-r--r--src/Search/FTSNotExpr.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/Search/FTSNotExpr.php b/src/Search/FTSNotExpr.php
new file mode 100644
index 0000000..a4aa219
--- /dev/null
+++ b/src/Search/FTSNotExpr.php
@@ -0,0 +1,29 @@
+<?php
+
+
+namespace Micropoly\Search;
+
+
+class FTSNotExpr extends AbstractFTSExpr
+{
+ private AbstractFTSExpr $expr;
+
+ /**
+ * FTSNotExpr constructor.
+ * @param AbstractFTSExpr $expr
+ */
+ public function __construct(AbstractFTSExpr $expr)
+ {
+ $this->expr = $expr;
+ }
+
+ protected function fts4Query(): string
+ {
+ return "-{$this->expr->fts4Query()}";
+ }
+
+ public function toString(): string
+ {
+ return "(FTS-NOT {$this->expr->toString()})";
+ }
+} \ No newline at end of file