Passed
Pull Request — master (#7)
by Vladislav
03:08
created

GetOrderRequest::setOrderLinkId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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