| 1 | <?php |
||
| 8 | class SortCondition |
||
| 9 | { |
||
| 10 | const ASC = 'ASC'; |
||
| 11 | const DESC = 'DESC'; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Column identifier to sort by |
||
| 15 | * |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | private $fieldName; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Method of sorting |
||
| 22 | * |
||
| 23 | * @var string |
||
| 24 | */ |
||
| 25 | private $method; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Sort direction: ASC or DESC |
||
| 29 | * |
||
| 30 | * @var string |
||
| 31 | */ |
||
| 32 | private $direction; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @param $fieldName |
||
| 36 | * @param $method |
||
| 37 | * @param $direction |
||
| 38 | */ |
||
| 39 | public function __construct($fieldName, $method, $direction) |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @return string |
||
| 48 | */ |
||
| 49 | public function getFieldName() |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @return string |
||
| 56 | */ |
||
| 57 | public function getMethod() |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @return string |
||
| 64 | */ |
||
| 65 | public function getDirection() |
||
| 69 | } |
||
| 70 |