GetOrderRequest::getOrderId()   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\GetOrder\Request;
4
5
use Carpenstar\ByBitAPI\Core\Objects\AbstractParameters;
6
use Carpenstar\ByBitAPI\Spot\Trade\GetOrder\Interfaces\IGetOrderRequestInterface;
7
8
class GetOrderRequest extends AbstractParameters implements IGetOrderRequestInterface
9
{
10
    /**
11
     * Order ID. Required if not passing orderLinkId
12
     * @var string $orderId
13
     */
14
    protected string $orderId;
15
16
    /**
17
     * Unique user-set order ID. Required if not passing orderId
18
     * @var string $orderLinkId
19
     */
20
    protected string $orderLinkId;
21
22
    /**
23
     * Order category. 0:normal order by default; 1:TP/SL order, Required for TP/SL order.
24
     * @var string $orderCategory
25
     */
26
    protected string $orderCategory;
27
28
    public function __construct()
29
    {
30
        $this->setRequiredBetweenField('orderId', 'orderLinkId');
31
    }
32
33
    /**
34
     * @param null|string $orderId
35
     * @return GetOrderRequest
36
     */
37
    public function setOrderId(?string $orderId): self
38
    {
39
        $this->orderId = $orderId;
40
        return $this;
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function getOrderId(): ?string
47
    {
48
        return $this->orderId;
49
    }
50
51
    /**
52
     * @param null|string $orderLinkId
53
     * @return GetOrderRequest
54
     */
55
    public function setOrderLinkId(?string $orderLinkId): self
56
    {
57
        $this->orderLinkId = $orderLinkId;
58
        return $this;
59
    }
60
61
    /**
62
     * @return string
63
     */
64
    public function getOrderLinkId(): ?string
65
    {
66
        return $this->orderLinkId;
67
    }
68
69
    /**
70
     * @param string $orderCategory
71
     * @return GetOrderRequest
72
     */
73
    public function setOrderCategory(string $orderCategory): self
74
    {
75
        $this->orderCategory = $orderCategory;
76
        return $this;
77
    }
78
79
    /**
80
     * @return string
81
     */
82
    public function getOrderCategory(): string
83
    {
84
        return $this->orderCategory;
85
    }
86
}
87