| Total Complexity | 6 |
| Total Lines | 68 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class Order extends AbstractPart |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var string $expr The expression to use into the order |
||
| 11 | */ |
||
| 12 | protected $expr; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var string|null $sort The sort order : ASC or DESC |
||
| 16 | */ |
||
| 17 | protected $sort; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Define the expression and the order to sort |
||
| 21 | * |
||
| 22 | * @param \BfwSql\Queries\AbstractQuery $querySystem |
||
| 23 | * @param string $expr The expression to use into the order |
||
| 24 | * @param string|null $sort The sort order : ASC or DESC |
||
| 25 | */ |
||
| 26 | public function __construct( |
||
| 27 | AbstractQuery $querySystem, |
||
| 28 | string $expr, |
||
| 29 | $sort = 'ASC' |
||
| 30 | ) { |
||
| 31 | parent::__construct($querySystem); |
||
| 32 | |||
| 33 | $this->expr = $expr; |
||
| 34 | $this->sort = $sort; |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Getter accessor to property expr |
||
| 39 | * |
||
| 40 | * @return string |
||
| 41 | */ |
||
| 42 | public function getExpr(): string |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Getter accessor to property expr |
||
| 49 | * |
||
| 50 | * @return string|null |
||
| 51 | */ |
||
| 52 | public function getSort() |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Generate the sql query for to this order expression |
||
| 59 | * |
||
| 60 | * @return string |
||
| 61 | */ |
||
| 62 | public function generate(): string |
||
| 78 |