Completed
Push — master ( a5ff2b...bf9940 )
by Yann
05:35
created

EntryTransactionDetail::getRelatedDates()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

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
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Genkgo\Camt\DTO;
4
5
use BadMethodCallException;
6
7
/**
8
 * Class EntryTransactionDetail
9
 * @package Genkgo\Camt\DTO
10
 */
11
class EntryTransactionDetail
12
{
13
    /**
14
     * @var Reference[]
15
     */
16
    private $references = [];
17
    /**
18
     * @var RelatedParty[]
19
     */
20
    private $relatedParties = [];
21
    /**
22
     * @var RelatedAgent[]
23
     */
24
    private $relatedAgents = [];
25
    /**
26
     * @var RemittanceInformation
27
     */
28
    private $remittanceInformation;
29
    /**
30
     * @var RelatedDates
31
     */
32
    private $relatedDates;
33
    /**
34
     * @var ReturnInformation
35
     */
36
    private $returnInformation;
37
    /**
38
     * @var AdditionalTransactionInformation
39
     */
40
    private $additionalTransactionInformation;
41
42
    /**
43
     * @var BankTransactionCode
44
     */
45
    private $bankTransactionCode;
46
47
    /**
48
     * @var Charges
49
     */
50
    private $charges;
51
52
    /**
53
     * @var AmountDetails
54
     */
55
    private $amountDetails;
56
57
    /**
58
     * @var Amount
59
     */
60
    private $amount;
61
62
    /**
63
     * @param Reference $reference
64
     */
65 16
    public function addReference(Reference $reference)
66
    {
67 16
        $this->references[] = $reference;
68 16
    }
69
70
    /**
71
     * @return Reference[]
72
     */
73 1
    public function getReferences()
74
    {
75 1
        return $this->references;
76
    }
77
78
    /**
79
     * @return Reference
80
     * @throws BadMethodCallException
81
     */
82 1
    public function getReference()
83
    {
84 1
        if (isset($this->references[0])) {
85 1
            return $this->references[0];
86
        } else {
87
            throw new BadMethodCallException('There are no references at all for this transaction');
88
        }
89
    }
90
91
    /**
92
     * @param RelatedParty $relatedParty
93
     */
94 20
    public function addRelatedParty(RelatedParty $relatedParty)
95
    {
96 20
        $this->relatedParties[] = $relatedParty;
97 20
    }
98
99
    /**
100
     * @return RelatedParty[]
101
     */
102 3
    public function getRelatedParties()
103
    {
104 3
        return $this->relatedParties;
105
    }
106
107
    /**
108
     * @return RelatedParty
109
     * @throws BadMethodCallException
110
     */
111 1
    public function getRelatedParty()
112
    {
113 1
        if (isset($this->relatedParties[0])) {
114 1
            return $this->relatedParties[0];
115
        } else {
116
            throw new BadMethodCallException('There are no related parties at all for this transaction');
117
        }
118
    }
119
120
    /**
121
     * @param RelatedAgent $relatedAgent
122
     */
123 16
    public function addRelatedAgent(RelatedAgent $relatedAgent)
124
    {
125 16
        $this->relatedAgents[] = $relatedAgent;
126 16
    }
127
128
    /**
129
     * @return RelatedAgent[]
130
     */
131 1
    public function getRelatedAgents()
132
    {
133 1
        return $this->relatedAgents;
134
    }
135
136
    /**
137
     * @return RelatedAgent
138
     * @throws BadMethodCallException
139
     */
140
    public function getRelatedAgent()
141
    {
142
        if (isset($this->relatedAgents[0])) {
143
            return $this->relatedAgents[0];
144
        } else {
145
            throw new BadMethodCallException('There are no related agents at all for this transaction');
146
        }
147
    }
148
149
    /**
150
     * @param RemittanceInformation $remittanceInformation
151
     */
152 16
    public function setRemittanceInformation(RemittanceInformation $remittanceInformation)
153
    {
154 16
        $this->remittanceInformation = $remittanceInformation;
155 16
    }
156
157
    /**
158
     * @return RemittanceInformation
159
     */
160 3
    public function getRemittanceInformation()
161
    {
162 3
        if ($this->remittanceInformation === null) {
163
            throw new BadMethodCallException();
164
        }
165 3
        return $this->remittanceInformation;
166
    }
167
    
168
    /**
169
     * @param RelatedDates $relatedDates
170
     */
171
    public function setRelatedDates(RelatedDates $relatedDates)
172
    {
173
        $this->relatedDates = $relatedDates;
174
    }
175
176
    /**
177
     * @return RelatedDates
178
     */
179
    public function getRelatedDates()
180
    {
181
        return $this->relatedDates;
182
    }    
183
184
    /**
185
     * @return ReturnInformation|null
186
     */
187
    public function getReturnInformation()
188
    {
189
        return $this->returnInformation;
190
    }
191
192
    /**
193
     * @param ReturnInformation $information
194
     */
195
    public function setReturnInformation(ReturnInformation $information)
196
    {
197
        $this->returnInformation = $information;
198
    }
199
200
    /**
201
     * @param AdditionalTransactionInformation $additionalTransactionInformation
202
     */
203
    public function setAdditionalTransactionInformation(AdditionalTransactionInformation $additionalTransactionInformation)
204
    {
205
        $this->additionalTransactionInformation = $additionalTransactionInformation;
206
    }
207
208
    /**
209
     * @return AdditionalTransactionInformation
210
     */
211
    public function getAdditionalTransactionInformation()
212
    {
213
        if ($this->additionalTransactionInformation === null) {
214
            throw new BadMethodCallException();
215
        }
216
        return $this->additionalTransactionInformation;
217
    }
218
219
    /**
220
     * @return BankTransactionCode
221
     */
222 1
    public function getBankTransactionCode()
223
    {
224 1
        return $this->bankTransactionCode;
225
    }
226
227
    /**
228
     * @param BankTransactionCode $bankTransactionCode
229
     */
230 20
    public function setBankTransactionCode(BankTransactionCode $bankTransactionCode)
231
    {
232 20
        $this->bankTransactionCode = $bankTransactionCode;
233 20
    }
234
235
    /**
236
     * @return Charges
237
     */
238
    public function getCharges()
239
    {
240
        return $this->charges;
241
    }
242
243
    /**
244
     * @param Charges $charges
245
     */
246 3
    public function setCharges(Charges $charges)
247
    {
248 3
        $this->charges = $charges;
249 3
    }
250
251
    /**
252
     * @return AmountDetails
253
     */
254
    public function getAmountDetails()
255
    {
256
        return $this->amountDetails;
257
    }
258
259
    /**
260
     * @param AmountDetails $amountDetails
261
     */
262 6
    public function setAmountDetails(AmountDetails $amountDetails)
263
    {
264 6
        $this->amountDetails = $amountDetails;
265 6
    }
266
267
    /**
268
     * @return Amount
269
     */
270
    public function getAmount()
271
    {
272
        return $this->amount;
273
    }
274
275
    /**
276
     * @param Amount $amount
277
     */
278 13
    public function setAmount(Amount $amount)
279
    {
280 13
        $this->amount = $amount;
281 13
    }    
282
283
}
284