xref: /dokuwiki/inc/Search/Query/NegatedEntry.php (revision 0b1bbbbb7d4e3c531cd255dbf878ce27d5967a0c)
1<?php
2
3namespace dokuwiki\Search\Query;
4
5/**
6 * Wraps a StackEntry to indicate logical NOT
7 *
8 * NOT does not compute a complement immediately. Instead, binary operators
9 * (AND, OR) detect NegatedEntry operands and choose the appropriate operation:
10 * AND with a NegatedEntry becomes set subtraction, avoiding the need to
11 * materialize the full page universe.
12 */
13class NegatedEntry implements StackEntry
14{
15    protected StackEntry $inner;
16
17    public function __construct(StackEntry $inner)
18    {
19        $this->inner = $inner;
20    }
21
22    /**
23     * @return StackEntry the wrapped entry (PageSet or NamespacePredicate)
24     */
25    public function getInner(): StackEntry
26    {
27        return $this->inner;
28    }
29}
30