OrderHistoryRequest::getEndTime()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Carpenstar\ByBitAPI\Spot\Trade\OrderHistory\Request;
4
5
use Carpenstar\ByBitAPI\Core\Helpers\DateTimeHelper;
6
use Carpenstar\ByBitAPI\Core\Objects\AbstractParameters;
7
use Carpenstar\ByBitAPI\Spot\Trade\OrderHistory\Interfaces\IOrderHistoryRequestInterface;
8
9
/**
10
 * Info: If startTime and endTime are both not specified, it returns last 7 days records by default.
11
 * 3 days records for institutional clients.
12
 * Supports fetching 3 months worth of data per request. Returns data up to 6 months old.
13
 */
14
class OrderHistoryRequest extends AbstractParameters implements IOrderHistoryRequestInterface
15
{
16
    /**
17
     * Name of the trading pair
18
     * @var string $symbol
19
     */
20
    protected string $symbol;
21
22
    /**
23
     * Specify orderId to return all the orders that orderId of which are smaller
24
     * than this particular one for pagination purpose
25
     * @var int $orderId
26
     */
27
    protected int $orderId;
28
29
    /**
30
     * Limit for data size. [1, 500]. Default: 100
31
     * @var int $limit = 100;
32
     */
33
    protected int $limit;
34
35
    /**
36
     * The start timestamp (ms)
37
     * @var int $startTime
38
     */
39
    protected int $startTime;
40
41
    /**
42
     * The end timestamp (ms)
43
     * @var int $endTime
44
     */
45
    protected int $endTime;
46
47
    /**
48
     * Order category. 0:normal order by default; 1:TP/SL order, Required for TP/SL order.
49
     * @var int $orderCategory
50
     */
51
    protected int $orderCategory;
52
53
    /**
54
     * @param string $symbol
55
     * @return OrderHistoryRequest
56
     */
57
    public function setSymbol(string $symbol): self
58
    {
59
        $this->symbol = $symbol;
60
        return $this;
61
    }
62
63
    /**
64
     * @return string
65
     */
66
    public function getSymbol(): string
67
    {
68
        return $this->symbol;
69
    }
70
71
    /**
72
     * @param int $orderId
73
     * @return OrderHistoryRequest
74
     */
75
    public function setOrderId(int $orderId): self
76
    {
77
        $this->orderId = $orderId;
78
        return $this;
79
    }
80
81
    /**
82
     * @return int
83
     */
84
    public function getOrderId(): int
85
    {
86
        return $this->orderId;
87
    }
88
89
    /**
90
     * @param int $limit
91
     * @return OrderHistoryRequest
92
     */
93
    public function setLimit(int $limit): self
94
    {
95
        $this->limit = $limit;
96
        return $this;
97
    }
98
99
    /**
100
     * @return int
101
     */
102
    public function getLimit(): int
103
    {
104
        return $this->limit;
105
    }
106
107
    /**
108
     * The start timestamp (ms)
109
     * @param string $dateTime
110
     * @return OrderHistoryRequest
111
     */
112
    public function setStartTime(string $dateTime): self
113
    {
114
        $this->startTime = DateTimeHelper::makeTimestampFromDateString($dateTime);
115
        return $this;
116
    }
117
118
    /**
119
     * @return int
120
     */
121
    public function getStartTime(): int
122
    {
123
        return $this->startTime;
124
    }
125
126
    /**
127
     * @param string $endTime
128
     * @return OrderHistoryRequest
129
     */
130
    public function setEndTime(string $endTime): self
131
    {
132
        $this->endTime = DateTimeHelper::makeTimestampFromDateString($endTime);
133
        return $this;
134
    }
135
136
    /**
137
     * @return int
138
     */
139
    public function getEndTime(): int
140
    {
141
        return $this->endTime;
142
    }
143
144
    /**
145
     * @param int $orderCategory
146
     * @return OrderHistoryRequest
147
     */
148
    public function setOrderCategory(int $orderCategory): self
149
    {
150
        $this->orderCategory = $orderCategory;
151
        return $this;
152
    }
153
154
    /**
155
     * @return int
156
     */
157
    public function getOrderCategory(): int
158
    {
159
        return $this->orderCategory;
160
    }
161
}
162