| Total Complexity | 3 |
| Total Lines | 61 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class Operators |
||
| 6 | { |
||
| 7 | const DEFAULT_OPERATOR = 'eq'; |
||
| 8 | |||
| 9 | private static $operatorMap = [ |
||
| 10 | 'eq' => [ |
||
| 11 | 'meta' => '=', |
||
| 12 | ], |
||
| 13 | 'neq' => [ |
||
| 14 | 'meta' => '!=', |
||
| 15 | ], |
||
| 16 | 'gt' => [ |
||
| 17 | 'meta' => '>', |
||
| 18 | ], |
||
| 19 | 'gte' => [ |
||
| 20 | 'meta' => '>=', |
||
| 21 | ], |
||
| 22 | 'lt' => [ |
||
| 23 | 'meta' => '<', |
||
| 24 | ], |
||
| 25 | 'lte' => [ |
||
| 26 | 'meta' => '<=', |
||
| 27 | ], |
||
| 28 | 'startswith' => [ |
||
| 29 | 'meta' => 'LIKE', |
||
| 30 | 'substitution_pattern' => '{string}%' |
||
| 31 | ], |
||
| 32 | 'contains' => [ |
||
| 33 | 'meta' => 'LIKE', |
||
| 34 | 'substitution_pattern' => '%{string}%' |
||
| 35 | ], |
||
| 36 | 'notcontains' => [ |
||
| 37 | 'meta' => 'NOT LIKE', |
||
| 38 | 'substitution_pattern' => '%{string}%' |
||
| 39 | ], |
||
| 40 | 'endswith' => [ |
||
| 41 | 'meta' => 'LIKE', |
||
| 42 | 'substitution_pattern' => '%{string}' |
||
| 43 | ], |
||
| 44 | 'list' => [ |
||
| 45 | 'meta' => 'IN', |
||
| 46 | 'substitution_pattern' => '({string})', |
||
| 47 | ], |
||
| 48 | 'field_eq' => [ |
||
| 49 | 'meta' => '=', |
||
| 50 | ], |
||
| 51 | ]; |
||
| 52 | |||
| 53 | public static function getAll() |
||
| 54 | { |
||
| 55 | return static::$operatorMap; |
||
|
|
|||
| 56 | } |
||
| 57 | |||
| 58 | public static function getDefaultOperator() |
||
| 61 | } |
||
| 62 | |||
| 63 | public static function get($operator) |
||
| 66 | } |
||
| 67 | } |
||
| 68 |