- $options = [];
- foreach ($values as $key => $value) {
- $options[$key] = new SearchOption($value);
- }
- return new self($options);
+ return $this->options;
+ }
+
+ /**
+ * @return self<T>
+ */
+ public function negated(): self
+ {
+ $values = array_values(array_filter($this->options, fn (SearchOption $option) => $option->negated));
+ return new self($values);
+ }
+
+ /**
+ * @return self<T>
+ */
+ public function nonNegated(): self
+ {
+ $values = array_values(array_filter($this->options, fn (SearchOption $option) => !$option->negated));
+ return new self($values);