| 1 | <?php |
||
| 8 | class FilterOperation implements OperationInterface{ |
||
| 9 | |||
| 10 | const OPERATOR_LIKE = 'like'; |
||
| 11 | const OPERATOR_STR_STARTS_WITH = 'str_starts_with'; |
||
| 12 | const OPERATOR_STR_ENDS_WITH = 'str_ends_with'; |
||
| 13 | const OPERATOR_STR_CONTAINS = 'str_contains'; |
||
| 14 | const OPERATOR_EQ = '='; |
||
| 15 | const OPERATOR_NOT_EQ = '<>'; |
||
| 16 | const OPERATOR_GT = '>'; |
||
| 17 | const OPERATOR_LT = '<'; |
||
| 18 | const OPERATOR_LTE = '<='; |
||
| 19 | const OPERATOR_GTE = '>='; |
||
| 20 | |||
| 21 | protected $field; |
||
| 22 | |||
| 23 | protected $value; |
||
| 24 | |||
| 25 | protected $operator; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Constructor. |
||
| 29 | * |
||
| 30 | * @param string|null $field name of data field to filter rows by its value |
||
| 31 | * @param string|null $operator |
||
| 32 | * @param mixed $value |
||
| 33 | */ |
||
| 34 | 3 | public function __construct( |
|
| 43 | |||
| 44 | /** |
||
| 45 | * Returns name of data field to filter rows by its value. |
||
| 46 | * |
||
| 47 | * @return string |
||
| 48 | */ |
||
| 49 | 3 | public function getField() |
|
| 53 | |||
| 54 | /** |
||
| 55 | * Sets name of data field to filter rows by its value. |
||
| 56 | * |
||
| 57 | * @param $field |
||
| 58 | * @return $this |
||
| 59 | */ |
||
| 60 | 3 | public function setField($field) |
|
| 65 | |||
| 66 | /** |
||
| 67 | * @return mixed |
||
| 68 | */ |
||
| 69 | 3 | public function getValue() |
|
| 73 | |||
| 74 | /** |
||
| 75 | * @param mixed $value |
||
| 76 | * @return $this |
||
| 77 | */ |
||
| 78 | 3 | public function setValue($value) |
|
| 83 | |||
| 84 | /** |
||
| 85 | * @return string |
||
| 86 | */ |
||
| 87 | 3 | public function getOperator() |
|
| 91 | |||
| 92 | /** |
||
| 93 | * @param $operator |
||
| 94 | * @return $this |
||
| 95 | */ |
||
| 96 | 3 | public function setOperator($operator) |
|
| 101 | } |
||
| 102 |