Passed
Push — master ( b12c40...c14c19 )
by
unknown
39s
created

LabelDelivery::getMemo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Ups\Entity;
4
5
use DOMDocument;
6
use DOMElement;
7
use Ups\NodeInterface;
8
9
class LabelDelivery implements NodeInterface
10
{
11
    /**
12
     * @var boolean
13
     */
14
    public $LabelLinkIndicator;
15
16
    /**
17
     * @var string
18
     */
19
    public $EMailAddress;
20
21
    /**
22
     * @var string
23
     */
24
    public $UndeliverableEMailAddress;
25
26
    /**
27
     * @var string
28
     */
29
    public $FromEMailAddress;
30
31
    /**
32
     * @var string
33
     */
34
    public $FromName;
35
36
    /**
37
     * @var string
38
     */
39
    public $Subject;
40
41
    /**
42
     * @var string
43
     */
44
    public $Memo;
45
46
    /**
47
     * @var string
48
     */
49
    public $SubjectCode;
50
51
    /**
52
     * @param \stdClass|null $response
53
     */
54 1
    public function __construct(\stdClass $response = null)
55
    {
56 1
        $this->LabelLinkIndicator = null;
57
58 1
        if (null !== $response) {
59
            if (isset($response->LabelLinkIndicator)) {
60
                $this->LabelLinkIndicator = true;
61
            }
62
63
            if (isset($response->EMailAddress)) {
64
                $this->setEmailAddress($response->EMailAddress);
65
            }
66
67
            if (isset($response->UndeliverableEMailAddress)) {
68
                $this->setUndeliverableEMailAddress($response->UndeliverableEMailAddress);
69
            }
70
71
            if (isset($response->FromEMailAddress)) {
72
                $this->setFromEMailAddress($response->FromEMailAddress);
73
            }
74
75
            if (isset($response->FromName)) {
76
                $this->setFromName($response->FromName);
77
            }
78
79
            if (isset($response->Subject)) {
80
                $this->setSubject($response->Subject);
81
            }
82
83
            if (isset($response->Memo)) {
84
                $this->setMemo($response->Memo);
85
            }
86
87
            if (isset($response->SubjectCode)) {
88
                $this->setSubjectCode($response->SubjectCode);
89
            }
90
        }
91 1
    }
92
93
    /**
94
     * @param null|DOMDocument $document
95
     * @return DOMElement
96
     */
97
    public function toNode(DOMDocument $document = null)
98
    {
99
        if (null === $document) {
100
            $document = new DOMDocument();
101
        }
102
103
        $node = $document->createElement('LabelDelivery');
104
105
        if (isset($this->LabelLinkIndicator)) {
106
            $node->appendChild($document->createElement('LabelLinkIndicator', $this->LabelLinkIndicator));
107
        }
108
109
        if (isset($this->EMailAddress)) {
110
            $node->appendChild($document->createElement('EMailAddress', $this->EMailAddress));
111
        }
112
113
        if (isset($this->UndeliverableEMailAddress)) {
114
            $node->appendChild($document->createElement('UndeliverableEMailAddress', $this->UndeliverableEMailAddress));
115
        }
116
117
        if (isset($this->FromEMailAddress)) {
118
            $node->appendChild($document->createElement('FromEMailAddress', $this->FromEMailAddress));
119
        }
120
121
        if (isset($this->FromName)) {
122
            $node->appendChild($document->createElement('FromName', $this->FromName));
123
        }
124
125
        if (isset($this->Subject)) {
126
            $node->appendChild($document->createElement('Subject', $this->Subject));
127
        }
128
129
        if (isset($this->Memo)) {
130
            $node->appendChild($document->createElement('Memo', $this->Memo));
131
        }
132
133
        if (isset($this->SubjectCode)) {
134
            $node->appendChild($document->createElement('SubjectCode', $this->SubjectCode));
135
        }
136
137
        return $node;
138
    }
139
140
    /**
141
     * @return string
142
     */
143
    public function getLabelLinkIndicator()
144
    {
145
        return $this->LabelLinkIndicator;
146
    }
147
148
    /**
149
     * @return $this
150
     */
151
    public function setLabelLinkIndicator($labelLinkIndicator)
152
    {
153
        $this->LabelLinkIndicator = $labelLinkIndicator;
154
155
        return $this;
156
    }
157
158
    /**
159
     * @return string
160
     */
161
    public function getEMailAddress()
162
    {
163
        return $this->EMailAddress;
164
    }
165
166
    /**
167
     * @return $this
168
     */
169
    public function setEMailAddress($eMailAddress)
170
    {
171
        $this->EMailAddress = $eMailAddress;
172
173
        return $this;
174
    }
175
176
    /**
177
     * @return string
178
     */
179
    public function getUndeliverableEMailAddress()
180
    {
181
        return $this->UndeliverableEMailAddress;
182
    }
183
184
    /**
185
     * @return $this
186
     */
187
    public function setUndeliverableEMailAddress($undeliverableEMailAddress)
188
    {
189
        $this->UndeliverableEMailAddress = $undeliverableEMailAddress;
190
191
        return $this;
192
    }
193
194
    /**
195
     * @return string
196
     */
197
    public function getFromEMailAddress()
198
    {
199
        return $this->FromEMailAddress;
200
    }
201
202
    /**
203
     * @return $this
204
     */
205
    public function setFromEMailAddress($fromEMailAddress)
206
    {
207
        $this->FromEMailAddress = $fromEMailAddress;
208
209
        return $this;
210
    }
211
212
    /**
213
     * @return string
214
     */
215
    public function getFromName()
216
    {
217
        return $this->FromName;
218
    }
219
220
    /**
221
     * @return $this
222
     */
223
    public function setFromName($fromName)
224
    {
225
        $this->FromName = $fromName;
226
227
        return $this;
228
    }
229
230
    /**
231
     * @return string
232
     */
233
    public function getSubject()
234
    {
235
        return $this->Subject;
236
    }
237
238
    /**
239
     * @return $this
240
     */
241
    public function setSubject($subject)
242
    {
243
        $this->Subject = $subject;
244
245
        return $this;
246
    }
247
248
    /**
249
     * @return string
250
     */
251
    public function getMemo()
252
    {
253
        return $this->Memo;
254
    }
255
256
    /**
257
     * @return $this
258
     */
259
    public function setMemo($memo)
260
    {
261
        $this->Memo = $memo;
262
263
        return $this;
264
    }
265
266
    /**
267
     * @return string
268
     */
269
    public function getSubjectCode()
270
    {
271
        return $this->SubjectCode;
272
    }
273
274
    /**
275
     * @return $this
276
     */
277
    public function setSubjectCode($subjectCode)
278
    {
279
        $this->SubjectCode = $subjectCode;
280
281
        return $this;
282
    }
283
}
284