RoomAvailabilityForStay   F
last analyzed

Complexity

Total Complexity 65

Size/Duplication

Total Lines 771
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 65
lcom 0
cbo 0
dl 0
loc 771
ccs 0
cts 304
cp 0
rs 2.6666
c 0
b 0
f 0

65 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 1
A getID_Room() 0 4 1
A setID_Room() 0 5 1
A getID_RoomType() 0 4 1
A setID_RoomType() 0 5 1
A getID_RoomTypeSuite() 0 4 1
A setID_RoomTypeSuite() 0 5 1
A getID_Building() 0 4 1
A setID_Building() 0 5 1
A getID_AccommodationType() 0 4 1
A setID_AccommodationType() 0 5 1
A getRoomNo() 0 4 1
A setRoomNo() 0 5 1
A getAddress1() 0 4 1
A setAddress1() 0 5 1
A getLastName() 0 4 1
A setLastName() 0 5 1
A getFirstName() 0 4 1
A setFirstName() 0 5 1
A getCity() 0 4 1
A setCity() 0 5 1
A getState() 0 4 1
A setState() 0 5 1
A getTitle() 0 4 1
A setTitle() 0 5 1
A getCountry() 0 4 1
A setCountry() 0 5 1
A getZipCode() 0 4 1
A setZipCode() 0 5 1
A getAddress2() 0 4 1
A setAddress2() 0 5 1
A getWebSiteURL() 0 4 1
A setWebSiteURL() 0 5 1
A getEmail() 0 4 1
A setEmail() 0 5 1
A getConfirmBy() 0 4 1
A setConfirmBy() 0 5 1
A getIsMailing() 0 4 1
A setIsMailing() 0 5 1
A getContactType() 0 4 1
A setContactType() 0 5 1
A getOtherCieName() 0 4 1
A setOtherCieName() 0 5 1
A getBillingType() 0 4 1
A setBillingType() 0 5 1
A getIsSoldByRoomNo() 0 4 1
A setIsSoldByRoomNo() 0 5 1
A getIsVirtual() 0 4 1
A setIsVirtual() 0 5 1
A getRankingByRevenue() 0 4 1
A setRankingByRevenue() 0 5 1
A getAssignPriority() 0 4 1
A setAssignPriority() 0 5 1
A getGrading() 0 4 1
A setGrading() 0 5 1
A getOldRoomNo() 0 4 1
A setOldRoomNo() 0 5 1
A getOptionalRoomName() 0 4 1
A setOptionalRoomName() 0 5 1
A getHousekeepingRoomStatus() 0 4 1
A setHousekeepingRoomStatus() 0 5 1
A getHousekeepingIsClosed() 0 4 1
A setHousekeepingIsClosed() 0 5 1
A getIsSuite() 0 4 1
A setIsSuite() 0 5 1

How to fix   Complexity   

Complex Class

Complex classes like RoomAvailabilityForStay often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use RoomAvailabilityForStay, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
namespace Gueststream\PMS\IQWare\API;
4
5
class RoomAvailabilityForStay
6
{
7
8
    /**
9
     * @var int $ID_Room
10
     */
11
    protected $ID_Room = null;
12
13
    /**
14
     * @var int $ID_RoomType
15
     */
16
    protected $ID_RoomType = null;
17
18
    /**
19
     * @var int $ID_RoomTypeSuite
20
     */
21
    protected $ID_RoomTypeSuite = null;
22
23
    /**
24
     * @var int $ID_Building
25
     */
26
    protected $ID_Building = null;
27
28
    /**
29
     * @var int $ID_AccommodationType
30
     */
31
    protected $ID_AccommodationType = null;
32
33
    /**
34
     * @var string $RoomNo
35
     */
36
    protected $RoomNo = null;
37
38
    /**
39
     * @var string $Address1
40
     */
41
    protected $Address1 = null;
42
43
    /**
44
     * @var string $LastName
45
     */
46
    protected $LastName = null;
47
48
    /**
49
     * @var string $FirstName
50
     */
51
    protected $FirstName = null;
52
53
    /**
54
     * @var string $City
55
     */
56
    protected $City = null;
57
58
    /**
59
     * @var string $State
60
     */
61
    protected $State = null;
62
63
    /**
64
     * @var string $Title
65
     */
66
    protected $Title = null;
67
68
    /**
69
     * @var string $Country
70
     */
71
    protected $Country = null;
72
73
    /**
74
     * @var string $ZipCode
75
     */
76
    protected $ZipCode = null;
77
78
    /**
79
     * @var string $Address2
80
     */
81
    protected $Address2 = null;
82
83
    /**
84
     * @var string $WebSiteURL
85
     */
86
    protected $WebSiteURL = null;
87
88
    /**
89
     * @var string $Email
90
     */
91
    protected $Email = null;
92
93
    /**
94
     * @var string $ConfirmBy
95
     */
96
    protected $ConfirmBy = null;
97
98
    /**
99
     * @var boolean $IsMailing
100
     */
101
    protected $IsMailing = null;
102
103
    /**
104
     * @var string $ContactType
105
     */
106
    protected $ContactType = null;
107
108
    /**
109
     * @var string $OtherCieName
110
     */
111
    protected $OtherCieName = null;
112
113
    /**
114
     * @var string $BillingType
115
     */
116
    protected $BillingType = null;
117
118
    /**
119
     * @var boolean $IsSoldByRoomNo
120
     */
121
    protected $IsSoldByRoomNo = null;
122
123
    /**
124
     * @var boolean $IsVirtual
125
     */
126
    protected $IsVirtual = null;
127
128
    /**
129
     * @var float $RankingByRevenue
130
     */
131
    protected $RankingByRevenue = null;
132
133
    /**
134
     * @var float $AssignPriority
135
     */
136
    protected $AssignPriority = null;
137
138
    /**
139
     * @var float $Grading
140
     */
141
    protected $Grading = null;
142
143
    /**
144
     * @var string $OldRoomNo
145
     */
146
    protected $OldRoomNo = null;
147
148
    /**
149
     * @var string $OptionalRoomName
150
     */
151
    protected $OptionalRoomName = null;
152
153
    /**
154
     * @var string $HousekeepingRoomStatus
155
     */
156
    protected $HousekeepingRoomStatus = null;
157
158
    /**
159
     * @var boolean $HousekeepingIsClosed
160
     */
161
    protected $HousekeepingIsClosed = null;
162
163
    /**
164
     * @var boolean $IsSuite
165
     */
166
    protected $IsSuite = null;
167
168
    /**
169
     * @param int $ID_Room
170
     * @param int $ID_RoomType
171
     * @param int $ID_RoomTypeSuite
172
     * @param int $ID_Building
173
     * @param int $ID_AccommodationType
174
     * @param boolean $IsMailing
175
     * @param boolean $IsSoldByRoomNo
176
     * @param boolean $IsVirtual
177
     * @param float $RankingByRevenue
178
     * @param float $AssignPriority
179
     * @param float $Grading
180
     * @param boolean $HousekeepingIsClosed
181
     * @param boolean $IsSuite
182
     */
183
    public function __construct($ID_Room, $ID_RoomType, $ID_RoomTypeSuite, $ID_Building, $ID_AccommodationType, $IsMailing, $IsSoldByRoomNo, $IsVirtual, $RankingByRevenue, $AssignPriority, $Grading, $HousekeepingIsClosed, $IsSuite)
184
    {
185
        $this->ID_Room = $ID_Room;
186
        $this->ID_RoomType = $ID_RoomType;
187
        $this->ID_RoomTypeSuite = $ID_RoomTypeSuite;
188
        $this->ID_Building = $ID_Building;
189
        $this->ID_AccommodationType = $ID_AccommodationType;
190
        $this->IsMailing = $IsMailing;
191
        $this->IsSoldByRoomNo = $IsSoldByRoomNo;
192
        $this->IsVirtual = $IsVirtual;
193
        $this->RankingByRevenue = $RankingByRevenue;
194
        $this->AssignPriority = $AssignPriority;
195
        $this->Grading = $Grading;
196
        $this->HousekeepingIsClosed = $HousekeepingIsClosed;
197
        $this->IsSuite = $IsSuite;
198
    }
199
200
    /**
201
     * @return int
202
     */
203
    public function getID_Room()
204
    {
205
        return $this->ID_Room;
206
    }
207
208
    /**
209
     * @param int $ID_Room
210
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
211
     */
212
    public function setID_Room($ID_Room)
213
    {
214
        $this->ID_Room = $ID_Room;
215
        return $this;
216
    }
217
218
    /**
219
     * @return int
220
     */
221
    public function getID_RoomType()
222
    {
223
        return $this->ID_RoomType;
224
    }
225
226
    /**
227
     * @param int $ID_RoomType
228
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
229
     */
230
    public function setID_RoomType($ID_RoomType)
231
    {
232
        $this->ID_RoomType = $ID_RoomType;
233
        return $this;
234
    }
235
236
    /**
237
     * @return int
238
     */
239
    public function getID_RoomTypeSuite()
240
    {
241
        return $this->ID_RoomTypeSuite;
242
    }
243
244
    /**
245
     * @param int $ID_RoomTypeSuite
246
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
247
     */
248
    public function setID_RoomTypeSuite($ID_RoomTypeSuite)
249
    {
250
        $this->ID_RoomTypeSuite = $ID_RoomTypeSuite;
251
        return $this;
252
    }
253
254
    /**
255
     * @return int
256
     */
257
    public function getID_Building()
258
    {
259
        return $this->ID_Building;
260
    }
261
262
    /**
263
     * @param int $ID_Building
264
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
265
     */
266
    public function setID_Building($ID_Building)
267
    {
268
        $this->ID_Building = $ID_Building;
269
        return $this;
270
    }
271
272
    /**
273
     * @return int
274
     */
275
    public function getID_AccommodationType()
276
    {
277
        return $this->ID_AccommodationType;
278
    }
279
280
    /**
281
     * @param int $ID_AccommodationType
282
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
283
     */
284
    public function setID_AccommodationType($ID_AccommodationType)
285
    {
286
        $this->ID_AccommodationType = $ID_AccommodationType;
287
        return $this;
288
    }
289
290
    /**
291
     * @return string
292
     */
293
    public function getRoomNo()
294
    {
295
        return $this->RoomNo;
296
    }
297
298
    /**
299
     * @param string $RoomNo
300
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
301
     */
302
    public function setRoomNo($RoomNo)
303
    {
304
        $this->RoomNo = $RoomNo;
305
        return $this;
306
    }
307
308
    /**
309
     * @return string
310
     */
311
    public function getAddress1()
312
    {
313
        return $this->Address1;
314
    }
315
316
    /**
317
     * @param string $Address1
318
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
319
     */
320
    public function setAddress1($Address1)
321
    {
322
        $this->Address1 = $Address1;
323
        return $this;
324
    }
325
326
    /**
327
     * @return string
328
     */
329
    public function getLastName()
330
    {
331
        return $this->LastName;
332
    }
333
334
    /**
335
     * @param string $LastName
336
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
337
     */
338
    public function setLastName($LastName)
339
    {
340
        $this->LastName = $LastName;
341
        return $this;
342
    }
343
344
    /**
345
     * @return string
346
     */
347
    public function getFirstName()
348
    {
349
        return $this->FirstName;
350
    }
351
352
    /**
353
     * @param string $FirstName
354
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
355
     */
356
    public function setFirstName($FirstName)
357
    {
358
        $this->FirstName = $FirstName;
359
        return $this;
360
    }
361
362
    /**
363
     * @return string
364
     */
365
    public function getCity()
366
    {
367
        return $this->City;
368
    }
369
370
    /**
371
     * @param string $City
372
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
373
     */
374
    public function setCity($City)
375
    {
376
        $this->City = $City;
377
        return $this;
378
    }
379
380
    /**
381
     * @return string
382
     */
383
    public function getState()
384
    {
385
        return $this->State;
386
    }
387
388
    /**
389
     * @param string $State
390
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
391
     */
392
    public function setState($State)
393
    {
394
        $this->State = $State;
395
        return $this;
396
    }
397
398
    /**
399
     * @return string
400
     */
401
    public function getTitle()
402
    {
403
        return $this->Title;
404
    }
405
406
    /**
407
     * @param string $Title
408
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
409
     */
410
    public function setTitle($Title)
411
    {
412
        $this->Title = $Title;
413
        return $this;
414
    }
415
416
    /**
417
     * @return string
418
     */
419
    public function getCountry()
420
    {
421
        return $this->Country;
422
    }
423
424
    /**
425
     * @param string $Country
426
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
427
     */
428
    public function setCountry($Country)
429
    {
430
        $this->Country = $Country;
431
        return $this;
432
    }
433
434
    /**
435
     * @return string
436
     */
437
    public function getZipCode()
438
    {
439
        return $this->ZipCode;
440
    }
441
442
    /**
443
     * @param string $ZipCode
444
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
445
     */
446
    public function setZipCode($ZipCode)
447
    {
448
        $this->ZipCode = $ZipCode;
449
        return $this;
450
    }
451
452
    /**
453
     * @return string
454
     */
455
    public function getAddress2()
456
    {
457
        return $this->Address2;
458
    }
459
460
    /**
461
     * @param string $Address2
462
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
463
     */
464
    public function setAddress2($Address2)
465
    {
466
        $this->Address2 = $Address2;
467
        return $this;
468
    }
469
470
    /**
471
     * @return string
472
     */
473
    public function getWebSiteURL()
474
    {
475
        return $this->WebSiteURL;
476
    }
477
478
    /**
479
     * @param string $WebSiteURL
480
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
481
     */
482
    public function setWebSiteURL($WebSiteURL)
483
    {
484
        $this->WebSiteURL = $WebSiteURL;
485
        return $this;
486
    }
487
488
    /**
489
     * @return string
490
     */
491
    public function getEmail()
492
    {
493
        return $this->Email;
494
    }
495
496
    /**
497
     * @param string $Email
498
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
499
     */
500
    public function setEmail($Email)
501
    {
502
        $this->Email = $Email;
503
        return $this;
504
    }
505
506
    /**
507
     * @return string
508
     */
509
    public function getConfirmBy()
510
    {
511
        return $this->ConfirmBy;
512
    }
513
514
    /**
515
     * @param string $ConfirmBy
516
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
517
     */
518
    public function setConfirmBy($ConfirmBy)
519
    {
520
        $this->ConfirmBy = $ConfirmBy;
521
        return $this;
522
    }
523
524
    /**
525
     * @return boolean
526
     */
527
    public function getIsMailing()
528
    {
529
        return $this->IsMailing;
530
    }
531
532
    /**
533
     * @param boolean $IsMailing
534
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
535
     */
536
    public function setIsMailing($IsMailing)
537
    {
538
        $this->IsMailing = $IsMailing;
539
        return $this;
540
    }
541
542
    /**
543
     * @return string
544
     */
545
    public function getContactType()
546
    {
547
        return $this->ContactType;
548
    }
549
550
    /**
551
     * @param string $ContactType
552
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
553
     */
554
    public function setContactType($ContactType)
555
    {
556
        $this->ContactType = $ContactType;
557
        return $this;
558
    }
559
560
    /**
561
     * @return string
562
     */
563
    public function getOtherCieName()
564
    {
565
        return $this->OtherCieName;
566
    }
567
568
    /**
569
     * @param string $OtherCieName
570
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
571
     */
572
    public function setOtherCieName($OtherCieName)
573
    {
574
        $this->OtherCieName = $OtherCieName;
575
        return $this;
576
    }
577
578
    /**
579
     * @return string
580
     */
581
    public function getBillingType()
582
    {
583
        return $this->BillingType;
584
    }
585
586
    /**
587
     * @param string $BillingType
588
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
589
     */
590
    public function setBillingType($BillingType)
591
    {
592
        $this->BillingType = $BillingType;
593
        return $this;
594
    }
595
596
    /**
597
     * @return boolean
598
     */
599
    public function getIsSoldByRoomNo()
600
    {
601
        return $this->IsSoldByRoomNo;
602
    }
603
604
    /**
605
     * @param boolean $IsSoldByRoomNo
606
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
607
     */
608
    public function setIsSoldByRoomNo($IsSoldByRoomNo)
609
    {
610
        $this->IsSoldByRoomNo = $IsSoldByRoomNo;
611
        return $this;
612
    }
613
614
    /**
615
     * @return boolean
616
     */
617
    public function getIsVirtual()
618
    {
619
        return $this->IsVirtual;
620
    }
621
622
    /**
623
     * @param boolean $IsVirtual
624
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
625
     */
626
    public function setIsVirtual($IsVirtual)
627
    {
628
        $this->IsVirtual = $IsVirtual;
629
        return $this;
630
    }
631
632
    /**
633
     * @return float
634
     */
635
    public function getRankingByRevenue()
636
    {
637
        return $this->RankingByRevenue;
638
    }
639
640
    /**
641
     * @param float $RankingByRevenue
642
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
643
     */
644
    public function setRankingByRevenue($RankingByRevenue)
645
    {
646
        $this->RankingByRevenue = $RankingByRevenue;
647
        return $this;
648
    }
649
650
    /**
651
     * @return float
652
     */
653
    public function getAssignPriority()
654
    {
655
        return $this->AssignPriority;
656
    }
657
658
    /**
659
     * @param float $AssignPriority
660
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
661
     */
662
    public function setAssignPriority($AssignPriority)
663
    {
664
        $this->AssignPriority = $AssignPriority;
665
        return $this;
666
    }
667
668
    /**
669
     * @return float
670
     */
671
    public function getGrading()
672
    {
673
        return $this->Grading;
674
    }
675
676
    /**
677
     * @param float $Grading
678
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
679
     */
680
    public function setGrading($Grading)
681
    {
682
        $this->Grading = $Grading;
683
        return $this;
684
    }
685
686
    /**
687
     * @return string
688
     */
689
    public function getOldRoomNo()
690
    {
691
        return $this->OldRoomNo;
692
    }
693
694
    /**
695
     * @param string $OldRoomNo
696
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
697
     */
698
    public function setOldRoomNo($OldRoomNo)
699
    {
700
        $this->OldRoomNo = $OldRoomNo;
701
        return $this;
702
    }
703
704
    /**
705
     * @return string
706
     */
707
    public function getOptionalRoomName()
708
    {
709
        return $this->OptionalRoomName;
710
    }
711
712
    /**
713
     * @param string $OptionalRoomName
714
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
715
     */
716
    public function setOptionalRoomName($OptionalRoomName)
717
    {
718
        $this->OptionalRoomName = $OptionalRoomName;
719
        return $this;
720
    }
721
722
    /**
723
     * @return string
724
     */
725
    public function getHousekeepingRoomStatus()
726
    {
727
        return $this->HousekeepingRoomStatus;
728
    }
729
730
    /**
731
     * @param string $HousekeepingRoomStatus
732
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
733
     */
734
    public function setHousekeepingRoomStatus($HousekeepingRoomStatus)
735
    {
736
        $this->HousekeepingRoomStatus = $HousekeepingRoomStatus;
737
        return $this;
738
    }
739
740
    /**
741
     * @return boolean
742
     */
743
    public function getHousekeepingIsClosed()
744
    {
745
        return $this->HousekeepingIsClosed;
746
    }
747
748
    /**
749
     * @param boolean $HousekeepingIsClosed
750
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
751
     */
752
    public function setHousekeepingIsClosed($HousekeepingIsClosed)
753
    {
754
        $this->HousekeepingIsClosed = $HousekeepingIsClosed;
755
        return $this;
756
    }
757
758
    /**
759
     * @return boolean
760
     */
761
    public function getIsSuite()
762
    {
763
        return $this->IsSuite;
764
    }
765
766
    /**
767
     * @param boolean $IsSuite
768
     * @return \Gueststream\PMS\IQWare\API\RoomAvailabilityForStay
769
     */
770
    public function setIsSuite($IsSuite)
771
    {
772
        $this->IsSuite = $IsSuite;
773
        return $this;
774
    }
775
}
776