GetRatesAndRoomsPricesBackToBack::__construct()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 22

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 24
ccs 0
cts 24
cp 0
rs 8.9713
c 0
b 0
f 0
cc 1
eloc 22
nc 1
nop 21
crap 2

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

1
<?php
2
3
namespace Gueststream\PMS\IQWare\API;
4
5
class GetRatesAndRoomsPricesBackToBack
6
{
7
8
    /**
9
     * @var ArrayOfInt $iGuids
10
     */
11
    protected $iGuids = null;
12
13
    /**
14
     * @var \DateTime $dtArrivalDate
15
     */
16
    protected $dtArrivalDate = null;
17
18
    /**
19
     * @var \DateTime $dtDepartureDate
20
     */
21
    protected $dtDepartureDate = null;
22
23
    /**
24
     * @var int $intGuestCount
25
     */
26
    protected $intGuestCount = null;
27
28
    /**
29
     * @var string $strChildrens
30
     */
31
    protected $strChildrens = null;
32
33
    /**
34
     * @var string $strISOLanguageCode
35
     */
36
    protected $strISOLanguageCode = null;
37
38
    /**
39
     * @var int $intID_AccommodationType
40
     */
41
    protected $intID_AccommodationType = null;
42
43
    /**
44
     * @var int $intRoomQty
45
     */
46
    protected $intRoomQty = null;
47
48
    /**
49
     * @var string $strListOfPromoRates
50
     */
51
    protected $strListOfPromoRates = null;
52
53
    /**
54
     * @var boolean $IsPromoByRate
55
     */
56
    protected $IsPromoByRate = null;
57
58
    /**
59
     * @var int $intRateSpecial
60
     */
61
    protected $intRateSpecial = null;
62
63
    /**
64
     * @var string $strAttributes
65
     */
66
    protected $strAttributes = null;
67
68
    /**
69
     * @var string $strLocations
70
     */
71
    protected $strLocations = null;
72
73
    /**
74
     * @var string $strRateCodes
75
     */
76
    protected $strRateCodes = null;
77
78
    /**
79
     * @var string $strRoomTypes
80
     */
81
    protected $strRoomTypes = null;
82
83
    /**
84
     * @var string $strBuildings
85
     */
86
    protected $strBuildings = null;
87
88
    /**
89
     * @var string $strBeddingIDs
90
     */
91
    protected $strBeddingIDs = null;
92
93
    /**
94
     * @var string $strAttributeGroupings
95
     */
96
    protected $strAttributeGroupings = null;
97
98
    /**
99
     * @var string $strLocationsGroupings
100
     */
101
    protected $strLocationsGroupings = null;
102
103
    /**
104
     * @var IAB2BMode $BackToBackMode
105
     */
106
    protected $BackToBackMode = null;
107
108
    /**
109
     * @var boolean $IsClusterVersion
110
     */
111
    protected $IsClusterVersion = null;
112
113
    /**
114
     * @param ArrayOfInt $iGuids
115
     * @param \DateTime $dtArrivalDate
116
     * @param \DateTime $dtDepartureDate
117
     * @param int $intGuestCount
118
     * @param string $strChildrens
119
     * @param string $strISOLanguageCode
120
     * @param int $intID_AccommodationType
121
     * @param int $intRoomQty
122
     * @param string $strListOfPromoRates
123
     * @param boolean $IsPromoByRate
124
     * @param int $intRateSpecial
125
     * @param string $strAttributes
126
     * @param string $strLocations
127
     * @param string $strRateCodes
128
     * @param string $strRoomTypes
129
     * @param string $strBuildings
130
     * @param string $strBeddingIDs
131
     * @param string $strAttributeGroupings
132
     * @param string $strLocationsGroupings
133
     * @param IAB2BMode $BackToBackMode
134
     * @param boolean $IsClusterVersion
135
     */
136
    public function __construct($iGuids, \DateTime $dtArrivalDate, \DateTime $dtDepartureDate, $intGuestCount, $strChildrens, $strISOLanguageCode, $intID_AccommodationType, $intRoomQty, $strListOfPromoRates, $IsPromoByRate, $intRateSpecial, $strAttributes, $strLocations, $strRateCodes, $strRoomTypes, $strBuildings, $strBeddingIDs, $strAttributeGroupings, $strLocationsGroupings, $BackToBackMode, $IsClusterVersion)
137
    {
138
        $this->iGuids = $iGuids;
139
        $this->dtArrivalDate = $dtArrivalDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $dtArrivalDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $dtArrivalDate.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
140
        $this->dtDepartureDate = $dtDepartureDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $dtDepartureDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $dtDepartureDate.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
141
        $this->intGuestCount = $intGuestCount;
142
        $this->strChildrens = $strChildrens;
143
        $this->strISOLanguageCode = $strISOLanguageCode;
144
        $this->intID_AccommodationType = $intID_AccommodationType;
145
        $this->intRoomQty = $intRoomQty;
146
        $this->strListOfPromoRates = $strListOfPromoRates;
147
        $this->IsPromoByRate = $IsPromoByRate;
148
        $this->intRateSpecial = $intRateSpecial;
149
        $this->strAttributes = $strAttributes;
150
        $this->strLocations = $strLocations;
151
        $this->strRateCodes = $strRateCodes;
152
        $this->strRoomTypes = $strRoomTypes;
153
        $this->strBuildings = $strBuildings;
154
        $this->strBeddingIDs = $strBeddingIDs;
155
        $this->strAttributeGroupings = $strAttributeGroupings;
156
        $this->strLocationsGroupings = $strLocationsGroupings;
157
        $this->BackToBackMode = $BackToBackMode;
158
        $this->IsClusterVersion = $IsClusterVersion;
159
    }
160
161
    /**
162
     * @return ArrayOfInt
163
     */
164
    public function getIGuids()
165
    {
166
        return $this->iGuids;
167
    }
168
169
    /**
170
     * @param ArrayOfInt $iGuids
171
     * @return \Gueststream\PMS\IQWare\API\GetRatesAndRoomsPricesBackToBack
172
     */
173
    public function setIGuids($iGuids)
174
    {
175
        $this->iGuids = $iGuids;
176
        return $this;
177
    }
178
179
    /**
180
     * @return \DateTime
181
     */
182
    public function getDtArrivalDate()
183
    {
184
        if ($this->dtArrivalDate == null) {
185
            return null;
186
        } else {
187
            try {
188
                return new \DateTime($this->dtArrivalDate);
189
            } catch (\Exception $e) {
190
                return false;
191
            }
192
        }
193
    }
194
195
    /**
196
     * @param \DateTime $dtArrivalDate
197
     * @return \Gueststream\PMS\IQWare\API\GetRatesAndRoomsPricesBackToBack
198
     */
199
    public function setDtArrivalDate(\DateTime $dtArrivalDate)
200
    {
201
        $this->dtArrivalDate = $dtArrivalDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $dtArrivalDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $dtArrivalDate.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
202
        return $this;
203
    }
204
205
    /**
206
     * @return \DateTime
207
     */
208
    public function getDtDepartureDate()
209
    {
210
        if ($this->dtDepartureDate == null) {
211
            return null;
212
        } else {
213
            try {
214
                return new \DateTime($this->dtDepartureDate);
215
            } catch (\Exception $e) {
216
                return false;
217
            }
218
        }
219
    }
220
221
    /**
222
     * @param \DateTime $dtDepartureDate
223
     * @return \Gueststream\PMS\IQWare\API\GetRatesAndRoomsPricesBackToBack
224
     */
225
    public function setDtDepartureDate(\DateTime $dtDepartureDate)
226
    {
227
        $this->dtDepartureDate = $dtDepartureDate->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $dtDepartureDate->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $dtDepartureDate.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
228
        return $this;
229
    }
230
231
    /**
232
     * @return int
233
     */
234
    public function getIntGuestCount()
235
    {
236
        return $this->intGuestCount;
237
    }
238
239
    /**
240
     * @param int $intGuestCount
241
     * @return \Gueststream\PMS\IQWare\API\GetRatesAndRoomsPricesBackToBack
242
     */
243
    public function setIntGuestCount($intGuestCount)
244
    {
245
        $this->intGuestCount = $intGuestCount;
246
        return $this;
247
    }
248
249
    /**
250
     * @return string
251
     */
252
    public function getStrChildrens()
253
    {
254
        return $this->strChildrens;
255
    }
256
257
    /**
258
     * @param string $strChildrens
259
     * @return \Gueststream\PMS\IQWare\API\GetRatesAndRoomsPricesBackToBack
260
     */
261
    public function setStrChildrens($strChildrens)
262
    {
263
        $this->strChildrens = $strChildrens;
264
        return $this;
265
    }
266
267
    /**
268
     * @return string
269
     */
270
    public function getStrISOLanguageCode()
271
    {
272
        return $this->strISOLanguageCode;
273
    }
274
275
    /**
276
     * @param string $strISOLanguageCode
277
     * @return \Gueststream\PMS\IQWare\API\GetRatesAndRoomsPricesBackToBack
278
     */
279
    public function setStrISOLanguageCode($strISOLanguageCode)
280
    {
281
        $this->strISOLanguageCode = $strISOLanguageCode;
282
        return $this;
283
    }
284
285
    /**
286
     * @return int
287
     */
288
    public function getIntID_AccommodationType()
289
    {
290
        return $this->intID_AccommodationType;
291
    }
292
293
    /**
294
     * @param int $intID_AccommodationType
295
     * @return \Gueststream\PMS\IQWare\API\GetRatesAndRoomsPricesBackToBack
296
     */
297
    public function setIntID_AccommodationType($intID_AccommodationType)
298
    {
299
        $this->intID_AccommodationType = $intID_AccommodationType;
300
        return $this;
301
    }
302
303
    /**
304
     * @return int
305
     */
306
    public function getIntRoomQty()
307
    {
308
        return $this->intRoomQty;
309
    }
310
311
    /**
312
     * @param int $intRoomQty
313
     * @return \Gueststream\PMS\IQWare\API\GetRatesAndRoomsPricesBackToBack
314
     */
315
    public function setIntRoomQty($intRoomQty)
316
    {
317
        $this->intRoomQty = $intRoomQty;
318
        return $this;
319
    }
320
321
    /**
322
     * @return string
323
     */
324
    public function getStrListOfPromoRates()
325
    {
326
        return $this->strListOfPromoRates;
327
    }
328
329
    /**
330
     * @param string $strListOfPromoRates
331
     * @return \Gueststream\PMS\IQWare\API\GetRatesAndRoomsPricesBackToBack
332
     */
333
    public function setStrListOfPromoRates($strListOfPromoRates)
334
    {
335
        $this->strListOfPromoRates = $strListOfPromoRates;
336
        return $this;
337
    }
338
339
    /**
340
     * @return boolean
341
     */
342
    public function getIsPromoByRate()
343
    {
344
        return $this->IsPromoByRate;
345
    }
346
347
    /**
348
     * @param boolean $IsPromoByRate
349
     * @return \Gueststream\PMS\IQWare\API\GetRatesAndRoomsPricesBackToBack
350
     */
351
    public function setIsPromoByRate($IsPromoByRate)
352
    {
353
        $this->IsPromoByRate = $IsPromoByRate;
354
        return $this;
355
    }
356
357
    /**
358
     * @return int
359
     */
360
    public function getIntRateSpecial()
361
    {
362
        return $this->intRateSpecial;
363
    }
364
365
    /**
366
     * @param int $intRateSpecial
367
     * @return \Gueststream\PMS\IQWare\API\GetRatesAndRoomsPricesBackToBack
368
     */
369
    public function setIntRateSpecial($intRateSpecial)
370
    {
371
        $this->intRateSpecial = $intRateSpecial;
372
        return $this;
373
    }
374
375
    /**
376
     * @return string
377
     */
378
    public function getStrAttributes()
379
    {
380
        return $this->strAttributes;
381
    }
382
383
    /**
384
     * @param string $strAttributes
385
     * @return \Gueststream\PMS\IQWare\API\GetRatesAndRoomsPricesBackToBack
386
     */
387
    public function setStrAttributes($strAttributes)
388
    {
389
        $this->strAttributes = $strAttributes;
390
        return $this;
391
    }
392
393
    /**
394
     * @return string
395
     */
396
    public function getStrLocations()
397
    {
398
        return $this->strLocations;
399
    }
400
401
    /**
402
     * @param string $strLocations
403
     * @return \Gueststream\PMS\IQWare\API\GetRatesAndRoomsPricesBackToBack
404
     */
405
    public function setStrLocations($strLocations)
406
    {
407
        $this->strLocations = $strLocations;
408
        return $this;
409
    }
410
411
    /**
412
     * @return string
413
     */
414
    public function getStrRateCodes()
415
    {
416
        return $this->strRateCodes;
417
    }
418
419
    /**
420
     * @param string $strRateCodes
421
     * @return \Gueststream\PMS\IQWare\API\GetRatesAndRoomsPricesBackToBack
422
     */
423
    public function setStrRateCodes($strRateCodes)
424
    {
425
        $this->strRateCodes = $strRateCodes;
426
        return $this;
427
    }
428
429
    /**
430
     * @return string
431
     */
432
    public function getStrRoomTypes()
433
    {
434
        return $this->strRoomTypes;
435
    }
436
437
    /**
438
     * @param string $strRoomTypes
439
     * @return \Gueststream\PMS\IQWare\API\GetRatesAndRoomsPricesBackToBack
440
     */
441
    public function setStrRoomTypes($strRoomTypes)
442
    {
443
        $this->strRoomTypes = $strRoomTypes;
444
        return $this;
445
    }
446
447
    /**
448
     * @return string
449
     */
450
    public function getStrBuildings()
451
    {
452
        return $this->strBuildings;
453
    }
454
455
    /**
456
     * @param string $strBuildings
457
     * @return \Gueststream\PMS\IQWare\API\GetRatesAndRoomsPricesBackToBack
458
     */
459
    public function setStrBuildings($strBuildings)
460
    {
461
        $this->strBuildings = $strBuildings;
462
        return $this;
463
    }
464
465
    /**
466
     * @return string
467
     */
468
    public function getStrBeddingIDs()
469
    {
470
        return $this->strBeddingIDs;
471
    }
472
473
    /**
474
     * @param string $strBeddingIDs
475
     * @return \Gueststream\PMS\IQWare\API\GetRatesAndRoomsPricesBackToBack
476
     */
477
    public function setStrBeddingIDs($strBeddingIDs)
478
    {
479
        $this->strBeddingIDs = $strBeddingIDs;
480
        return $this;
481
    }
482
483
    /**
484
     * @return string
485
     */
486
    public function getStrAttributeGroupings()
487
    {
488
        return $this->strAttributeGroupings;
489
    }
490
491
    /**
492
     * @param string $strAttributeGroupings
493
     * @return \Gueststream\PMS\IQWare\API\GetRatesAndRoomsPricesBackToBack
494
     */
495
    public function setStrAttributeGroupings($strAttributeGroupings)
496
    {
497
        $this->strAttributeGroupings = $strAttributeGroupings;
498
        return $this;
499
    }
500
501
    /**
502
     * @return string
503
     */
504
    public function getStrLocationsGroupings()
505
    {
506
        return $this->strLocationsGroupings;
507
    }
508
509
    /**
510
     * @param string $strLocationsGroupings
511
     * @return \Gueststream\PMS\IQWare\API\GetRatesAndRoomsPricesBackToBack
512
     */
513
    public function setStrLocationsGroupings($strLocationsGroupings)
514
    {
515
        $this->strLocationsGroupings = $strLocationsGroupings;
516
        return $this;
517
    }
518
519
    /**
520
     * @return IAB2BMode
521
     */
522
    public function getBackToBackMode()
523
    {
524
        return $this->BackToBackMode;
525
    }
526
527
    /**
528
     * @param IAB2BMode $BackToBackMode
529
     * @return \Gueststream\PMS\IQWare\API\GetRatesAndRoomsPricesBackToBack
530
     */
531
    public function setBackToBackMode($BackToBackMode)
532
    {
533
        $this->BackToBackMode = $BackToBackMode;
534
        return $this;
535
    }
536
537
    /**
538
     * @return boolean
539
     */
540
    public function getIsClusterVersion()
541
    {
542
        return $this->IsClusterVersion;
543
    }
544
545
    /**
546
     * @param boolean $IsClusterVersion
547
     * @return \Gueststream\PMS\IQWare\API\GetRatesAndRoomsPricesBackToBack
548
     */
549
    public function setIsClusterVersion($IsClusterVersion)
550
    {
551
        $this->IsClusterVersion = $IsClusterVersion;
552
        return $this;
553
    }
554
}
555