blob: 75b32890b8b74a44c055300966659363043107d8 [file] [log] [blame]
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +02001<?php
2
3namespace Adldap\Query;
4
5use ReflectionClass;
6
7class Operator
8{
9 /**
10 * The 'has' wildcard operator.
11 *
12 * @var string
13 */
14 public static $has = '*';
15
16 /**
17 * The custom `notHas` operator.
18 *
19 * @var string
20 */
21 public static $notHas = '!*';
22
23 /**
24 * The equals operator.
25 *
26 * @var string
27 */
28 public static $equals = '=';
29
30 /**
31 * The does not equal operator.
32 *
33 * @var string
34 */
35 public static $doesNotEqual = '!';
36
37 /**
38 * The does not equal operator (alias).
39 *
40 * @var string
41 */
42 public static $doesNotEqualAlias = '!=';
43
44 /**
45 * The greater than or equal to operator.
46 *
47 * @var string
48 */
49 public static $greaterThanOrEquals = '>=';
50
51 /**
52 * The less than or equal to operator.
53 *
54 * @var string
55 */
56 public static $lessThanOrEquals = '<=';
57
58 /**
59 * The approximately equal to operator.
60 *
61 * @var string
62 */
63 public static $approximatelyEquals = '~=';
64
65 /**
66 * The custom starts with operator.
67 *
68 * @var string
69 */
70 public static $startsWith = 'starts_with';
71
72 /**
73 * The custom not starts with operator.
74 *
75 * @var string
76 */
77 public static $notStartsWith = 'not_starts_with';
78
79 /**
80 * The custom ends with operator.
81 *
82 * @var string
83 */
84 public static $endsWith = 'ends_with';
85
86 /**
87 * The custom not ends with operator.
88 *
89 * @var string
90 */
91 public static $notEndsWith = 'not_ends_with';
92
93 /**
94 * The custom contains operator.
95 *
96 * @var string
97 */
98 public static $contains = 'contains';
99
100 /**
101 * The custom not contains operator.
102 *
103 * @var string
104 */
105 public static $notContains = 'not_contains';
106
107 /**
108 * Returns all available operators.
109 *
110 * @return array
111 */
112 public static function all()
113 {
114 return (new ReflectionClass(new static()))->getStaticProperties();
115 }
116}