RequestData   A
last analyzed

Complexity

Total Complexity 13

Size/Duplication

Total Lines 206
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 63.64%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 13
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 206
ccs 21
cts 33
cp 0.6364
rs 10

13 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getSubscriptionId() 0 4 1
A setSubscriptionId() 0 4 1
A getNextEvent() 0 4 1
A setNextEvent() 0 6 1
A getSubscriptionExternalId() 0 4 1
A setSubscriptionExternalId() 0 6 1
A getStatus() 0 4 1
A setStatus() 0 6 1
A getXAttributes() 0 4 1
A setXAttributes() 0 6 1
A getFeatures() 0 4 1
A setFeatures() 0 6 1
1
<?php
2
3
namespace Speicher210\Fastbill\Api\Service\Subscription\Update;
4
5
use JMS\Serializer\Annotation as JMS;
6
use Speicher210\Fastbill\Api\AbstractRequestData;
7
use Speicher210\Fastbill\Api\Model\Feature;
8
9
/**
10
 * The request data for updating a subscription.
11
 */
12
final class RequestData extends AbstractRequestData
13
{
14
    /**
15
     * The subscription ID.
16
     *
17
     * @var integer
18
     *
19
     * @JMS\Type("integer")
20
     * @JMS\SerializedName("SUBSCRIPTION_ID")
21
     */
22
    protected $subscriptionId;
23
24
    /**
25
     *  The subscription next event.
26
     *
27
     * @var \DateTime
28
     *
29
     * @JMS\Type("DateTime<'Y-m-d H:i:s'>")
30
     * @JMS\SerializedName("NEXT_EVENT")
31
     */
32
    protected $nextEvent;
33
34
    /**
35
     * The external subscription ID.
36
     *
37
     * @var string
38
     *
39
     * @JMS\Type("string")
40
     * @JMS\SerializedName("SUBSCRIPTION_EXT_UID")
41
     */
42
    protected $subscriptionExternalId;
43
44
    /**
45
     * The subscription status.
46
     *
47
     * @var string
48
     *
49
     * @JMS\Type("string")
50
     * @JMS\SerializedName("STATUS")
51
     */
52
    protected $status;
53
54
    /**
55
     * The subscription X-Attribute.
56
     *
57
     * @var array
58
     *
59
     * @JMS\Type("array")
60
     * @JMS\SerializedName("X_ATTRIBUTES")
61
     */
62
    protected $xAttributes = array();
63
64
    /**
65
     * Product features.
66
     *
67
     * @var array
68
     *
69
     * @JMS\Type("array<Speicher210\Fastbill\Api\Model\Feature>")
70
     * @JMS\SerializedName("FEATURES")
71
     */
72
    protected $features = array();
73
74
    /**
75
     * Constructor.
76
     *
77
     * @param integer $subscriptionId The subscription ID.
78
     */
79 3
    public function __construct($subscriptionId)
80
    {
81 3
        $this->setSubscriptionId($subscriptionId);
82 3
    }
83
84
    /**
85
     * Get the subscription ID of the request body.
86
     *
87
     * @return integer
88
     */
89
    public function getSubscriptionId()
90
    {
91
        return $this->subscriptionId;
92
    }
93
94
    /**
95
     * Set the subscription ID.
96
     *
97
     * @param integer $subscriptionId The subscription ID.
98
     * @return RequestData
99
     */
100 3
    public function setSubscriptionId($subscriptionId)
101
    {
102 3
        $this->subscriptionId = $subscriptionId;
103 3
    }
104
105
    /**
106
     * Get the next event date and time.
107
     *
108
     * @return \DateTime
109
     */
110
    public function getNextEvent()
111
    {
112
        return $this->nextEvent;
113
    }
114
115
    /**
116
     * Set the next event date and time.
117
     *
118
     * @param \DateTime $nextEvent The next event date and time.
119
     * @return RequestData
120
     */
121 3
    public function setNextEvent(\DateTime $nextEvent = null)
122
    {
123 3
        $this->nextEvent = $nextEvent;
124
125 3
        return $this;
126
    }
127
128
    /**
129
     * Get the external subscription ID.
130
     *
131
     * @return string
132
     */
133
    public function getSubscriptionExternalId()
134
    {
135
        return $this->subscriptionExternalId;
136
    }
137
138
    /**
139
     * Set the external subscription ID.
140
     *
141
     * @param string $subscriptionExternalId The external subscription ID.
142
     * @return RequestData
143
     */
144 3
    public function setSubscriptionExternalId($subscriptionExternalId)
145
    {
146 3
        $this->subscriptionExternalId = $subscriptionExternalId;
147
148 3
        return $this;
149
    }
150
151
    /**
152
     * Get the subscription status.
153
     *
154
     * @return string
155
     */
156
    public function getStatus()
157
    {
158
        return $this->status;
159
    }
160
161
    /**
162
     * Set the subscription status.
163
     *
164
     * @param string $status The subscription status.
165
     * @return RequestData
166
     */
167 3
    public function setStatus($status)
168
    {
169 3
        $this->status = $status;
170
171 3
        return $this;
172
    }
173
174
    /**
175
     * @return array
176
     */
177
    public function getXAttributes()
178
    {
179
        return $this->xAttributes;
180
    }
181
182
    /**
183
     * Set the subscription x attributes.
184
     *
185
     * @param array $xAttributes The subscription x attributes
186
     * @return RequestData
187
     */
188 3
    public function setXAttributes(array $xAttributes)
189
    {
190 3
        $this->xAttributes = $xAttributes;
191
192 3
        return $this;
193
    }
194
195
    /**
196
     * Get the features.
197
     *
198
     * @return array
199
     */
200
    public function getFeatures()
201
    {
202
        return $this->features;
203
    }
204
205
    /**
206
     * Set the features.
207
     *
208
     * @param Feature[] $features The features.
209
     * @return RequestData
210
     */
211 3
    public function setFeatures(array $features)
212
    {
213 3
        $this->features = $features;
214
215 3
        return $this;
216
    }
217
}
218