GetCallByPhoneRequest::setPhone()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
namespace Phrlog\Zvonok\Phone\Request;
4
5
/**
6
 * Class GetCallByPhoneRequest
7
 */
8
class GetCallByPhoneRequest extends BaseRequest
9
{
10
    protected const URI = '/lk/cabapi_external/api/v1/phones/calls_by_phone/';
11
12
    /**
13
     * @var string
14
     */
15
    protected $phone;
16
17
    /**
18
     * @var string
19
     */
20
    protected $campaign_id;
21
22
    /**
23
     * @var string
24
     */
25
    protected $from_created_date;
26
27
    /**
28
     * @var string
29
     */
30
    protected $to_created_date;
31
32
    /**
33
     * @var string
34
     */
35
    protected $from_updated_date;
36
37
    /**
38
     * @var string
39
     */
40
    protected $to_updated_date;
41
42
    /**
43
     * GetCallByPhoneRequest constructor.
44
     * @param string $phone
45
     * @param string $campaignId
46
     */
47
    public function __construct(string $phone, string $campaignId)
48
    {
49
        $this->phone = $phone;
50
        $this->campaign_id = $campaignId;
51
    }
52
53
    /**
54
     * @param string $phone
55
     *
56
     * @return $this
57
     */
58
    public function setPhone(string $phone): self
59
    {
60
        $this->phone = $phone;
61
62
        return $this;
63
    }
64
65
    /**
66
     * @param string $campaignId
67
     *
68
     * @return $this
69
     */
70
    public function setCampaignId(string $campaignId): self
71
    {
72
        $this->campaign_id = $campaignId;
73
74
        return $this;
75
    }
76
77
    /**
78
     * @param string $fromCreatedDate
79
     *
80
     * @return $this
81
     */
82
    public function setFromCreatedDate(string $fromCreatedDate): self
83
    {
84
        $this->from_created_date = $fromCreatedDate;
85
86
        return $this;
87
    }
88
89
    /**
90
     * @param string $toCreatedDate
91
     *
92
     * @return $this
93
     */
94
    public function setToCreatedDate(string $toCreatedDate): self
95
    {
96
        $this->to_created_date = $toCreatedDate;
97
98
        return $this;
99
    }
100
101
    /**
102
     * @param string $fromUpdatedDate
103
     *
104
     * @return $this
105
     */
106
    public function setFromUpdatedDate(string $fromUpdatedDate): self
107
    {
108
        $this->from_updated_date = $fromUpdatedDate;
109
110
        return $this;
111
    }
112
113
    /**
114
     * @param string $toUpdatedDate
115
     *
116
     * @return $this
117
     */
118
    public function setToUpdatedDate(string $toUpdatedDate): self
119
    {
120
        $this->to_updated_date = $toUpdatedDate;
121
122
        return $this;
123
    }
124
125
    /**
126
     * @return array
127
     */
128
    protected function getAvailableParams(): array
129
    {
130
        return [
131
            'campaign_id',
132
            'phone',
133
            'from_created_date',
134
            'to_created_date',
135
            'from_updated_date',
136
            'to_updated_date'
137
        ];
138
    }
139
140
    /**
141
     * @return string
142
     */
143
    protected function getUri(): string
144
    {
145
        return static::URI;
146
    }
147
}
148