-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathOrderField.php
More file actions
63 lines (56 loc) · 1.17 KB
/
OrderField.php
File metadata and controls
63 lines (56 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
namespace Aternos\Model\Query;
/**
* Class OrderField
*
* @package Aternos\Model\Query
*/
class OrderField
{
/** @deprecated */
const Direction ASCENDING = Direction::ASCENDING;
/** @deprecated */
const Direction DESCENDING = Direction::DESCENDING;
/**
* @var bool
*/
public bool $raw = false;
/**
* OrderField constructor.
*
* @param string|null $field
* @param Direction $direction
*/
public function __construct(
public ?string $field = null,
public Direction $direction = Direction::ASCENDING)
{
}
/**
* @param bool $raw
* @return OrderField
*/
public function setRaw(bool $raw): OrderField
{
$this->raw = $raw;
return $this;
}
/**
* @param Direction $direction
* @return OrderField
*/
public function setDirection(Direction $direction): OrderField
{
$this->direction = $direction;
return $this;
}
/**
* @param string $field
* @return OrderField
*/
public function setField(string $field): OrderField
{
$this->field = $field;
return $this;
}
}