1 | <?php |
||
36 | class Operator extends AbstractDeactivatableParameterBuilder implements ParameterBuilder |
||
37 | { |
||
38 | const OPERATOR_AND = 'AND'; |
||
39 | const OPERATOR_OR = 'OR'; |
||
40 | |||
41 | /** |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $operator = 'AND'; |
||
45 | |||
46 | /** |
||
47 | * Faceting constructor. |
||
48 | * |
||
49 | * @param bool $isEnabled |
||
50 | * @param string $operator |
||
51 | */ |
||
52 | public function __construct($isEnabled, $operator = Operator::OPERATOR_AND) |
||
57 | |||
58 | /** |
||
59 | * @param string $operator |
||
60 | */ |
||
61 | public function setOperator($operator) |
||
69 | |||
70 | /** |
||
71 | * @return Operator |
||
72 | */ |
||
73 | public static function getEmpty(): Operator |
||
77 | |||
78 | /** |
||
79 | * @return Operator |
||
80 | */ |
||
81 | public static function getAnd(): Operator |
||
85 | |||
86 | /** |
||
87 | * @return Operator |
||
88 | */ |
||
89 | public static function getOr(): Operator |
||
93 | |||
94 | /** |
||
95 | * @param Query $query |
||
96 | * @return Query |
||
97 | */ |
||
98 | public function build(Query $query): Query |
||
108 | |||
109 | /** |
||
110 | * @param string $operator |
||
111 | * @return Operator |
||
112 | */ |
||
113 | public static function fromString($operator) |
||
117 | } |