]> BookStack Code Mirror - bookstack/blob - app/Search/Options/SearchOption.php
respective book and chapter structure added.
[bookstack] / app / Search / Options / SearchOption.php
1 <?php
2
3 namespace BookStack\Search\Options;
4
5 abstract class SearchOption
6 {
7     public function __construct(
8         public string $value,
9         public bool $negated = false,
10     ) {
11     }
12
13     /**
14      * Get the key used for this option when used in a map.
15      * Null indicates to use the index of the containing array.
16      */
17     public function getKey(): string|null
18     {
19         return null;
20     }
21
22     /**
23      * Get the search string representation for this search option.
24      */
25     abstract public function toString(): string;
26 }