Passed
Branch master (97cc57)
by Nils
02:49
created

TablePosition::setGoalsHome()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace Torakel\DatabaseBundle\Entity;
3
4
use Doctrine\Common\Collections\ArrayCollection;
5
use Doctrine\ORM\Mapping as ORM;
0 ignored issues
show
Bug introduced by
The type Doctrine\ORM\Mapping was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
/**
8
 * @ORM\Entity
9
 * @ORM\HasLifecycleCallbacks
10
 * @ORM\Entity(repositoryClass="Torakel\DatabaseBundle\Repository\TablePositionRepository")
11
 * @ORM\Table(name="table_position")
12
 */
13
class TablePosition
14
{
15
16
    /**
17
     * @var integer
18
     * @ORM\Column(type="integer")
19
     * @ORM\Id
20
     * @ORM\GeneratedValue(strategy="AUTO")
21
     */
22
    private $id;
23
24
    /**
25
     * @var string
26
     * @ORM\Column(type="integer", nullable=true)
27
     */
28
    protected $position;
29
30
    /**
31
     * @var \Torakel\DatabaseBundle\Entity\Team
32
     * @ORM\ManyToOne(targetEntity="\Torakel\DatabaseBundle\Entity\Team", inversedBy="tablePositions")
33
     * @ORM\JoinColumn(name="team_id", referencedColumnName="id")
34
     */
35
    protected $team;
36
37
    /**
38
     * @var integer
39
     * @ORM\Column(type="integer", name="games_played")
40
     */
41
    protected $gamesPlayed;
42
43
    /**
44
     * @var integer
45
     * @ORM\Column(type="integer", nullable=true)
46
     */
47
    protected $points;
48
49
    /**
50
     * @var integer
51
     * @ORM\Column(type="integer", name="points_away")
52
     */
53
    protected $pointsAway;
54
55
    /**
56
     * @var integer
57
     * @ORM\Column(type="integer", name="points_home")
58
     */
59
    protected $pointsHome;
60
61
    /**
62
     * @var integer
63
     * @ORM\Column(type="integer")
64
     */
65
    protected $wins;
66
67
    /**
68
     * @var integer
69
     * @ORM\Column(type="integer", name="wins_away")
70
     */
71
    protected $winsAway;
72
73
    /**
74
     * @var integer
75
     * @ORM\Column(type="integer", name="wins_home")
76
     */
77
    protected $winsHome;
78
79
    /**
80
     * @var integer
81
     * @ORM\Column(type="integer")
82
     */
83
    protected $losses;
84
85
    /**
86
     * @var integer
87
     * @ORM\Column(type="integer", name="losses_away")
88
     */
89
    protected $lossesAway;
90
91
    /**
92
     * @var integer
93
     * @ORM\Column(type="integer", name="losses_home")
94
     */
95
    protected $lossesHome;
96
97
    /**
98
     * @var integer
99
     * @ORM\Column(type="integer")
100
     */
101
    protected $draws;
102
103
    /**
104
     * @var integer
105
     * @ORM\Column(type="integer", name="draws_away")
106
     */
107
    protected $drawsAway;
108
109
    /**
110
     * @var integer
111
     * @ORM\Column(type="integer", name="draws_home")
112
     */
113
    protected $drawsHome;
114
115
    /**
116
     * @var integer
117
     * @ORM\Column(type="integer")
118
     */
119
    protected $goals;
120
121
    /**
122
     * @var integer
123
     * @ORM\Column(type="integer", name="goals_away")
124
     */
125
    protected $goalsAway;
126
127
    /**
128
     * @var integer
129
     * @ORM\Column(type="integer", name="goals_home")
130
     */
131
    protected $goalsHome;
132
133
    /**
134
     * @var integer
135
     * @ORM\Column(type="integer", name="goals_against")
136
     */
137
    protected $goalsAgainst;
138
139
    /**
140
     * @var integer
141
     * @ORM\Column(type="integer", name="goals_against_away")
142
     */
143
    protected $goalsAgainstAway;
144
145
    /**
146
     * @var integer
147
     * @ORM\Column(type="integer", name="goals_against_home")
148
     */
149
    protected $goalsAgainstHome;
150
151
    /**
152
     * @var integer
153
     * @ORM\Column(type="integer", name="goal_difference")
154
     */
155
    protected $goalDifference;
156
157
    /**
158
     * @var integer
159
     * @ORM\Column(type="integer", name="goal_difference_away")
160
     */
161
    protected $goalDifferenceAway;
162
163
    /**
164
     * @var integer
165
     * @ORM\Column(type="integer", name="goal_difference_home")
166
     */
167
    protected $goalDifferenceHome;
168
169
    /**
170
     * @var \Torakel\DatabaseBundle\Entity\MatchdayTable
171
     * @ORM\ManyToOne(targetEntity="\Torakel\DatabaseBundle\Entity\MatchdayTable", inversedBy="tablePositions")
172
     * @ORM\JoinColumn(name="matchday_table_id", referencedColumnName="id")
173
     */
174
    protected $matchdayTable;
175
176
    /**
177
     * @var \DateTime
178
     * @ORM\Column(type="datetime", name="created_at")
179
     */
180
    protected $createdAt;
181
182
    /**
183
     * @var \DateTime
184
     * @ORM\Column(type="datetime", name="updated_at", nullable=true)
185
     */
186
    protected $updatedAt;
187
188
    /**
189
     * Constructor
190
     */
191 4
    public function __construct()
192
    {
193 4
        $this->points = 0;
194 4
        $this->pointsAway = 0;
195 4
        $this->pointsHome = 0;
196 4
        $this->wins = 0;
197 4
        $this->winsAway = 0;
198 4
        $this->winsHome = 0;
199 4
        $this->losses = 0;
200 4
        $this->lossesAway = 0;
201 4
        $this->lossesHome = 0;
202 4
        $this->draws = 0;
203 4
        $this->drawsAway = 0;
204 4
        $this->drawsHome = 0;
205 4
        $this->goals = 0;
206 4
        $this->goalsAway = 0;
207 4
        $this->goalsHome = 0;
208 4
        $this->goalsAgainst = 0;
209 4
        $this->goalsAgainstAway = 0;
210 4
        $this->goalsAgainstHome = 0;
211 4
        $this->goalDifference = 0;
212 4
        $this->goalDifferenceAway = 0;
213 4
        $this->goalDifferenceHome = 0;
214 4
    }
215
216 1
    public function __clone()
217
    {
218 1
        $this->id = null;
219 1
    }
220
221
    /**
222
     * @ORM\PrePersist
223
     */
224 1
    public function prePersist()
225
    {
226 1
        $this->createdAt = new \DateTime();
227 1
    }
228
229
    /**
230
     * @ORM\PreUpdate
231
     */
232 1
    public function preUpdate()
233
    {
234 1
        $this->updatedAt = new \DateTime();
235 1
    }
236
237
    /**
238
     * Get id
239
     *
240
     * @return integer
241
     */
242 2
    public function getId()
243
    {
244 2
        return $this->id;
245
    }
246
247
    /**
248
     * Set position
249
     *
250
     * @param string $position
251
     *
252
     * @return TablePosition
253
     */
254 1
    public function setPosition($position)
255
    {
256 1
        $this->position = $position;
257
258 1
        return $this;
259
    }
260
261
    /**
262
     * Get position
263
     *
264
     * @return string
265
     */
266 1
    public function getPosition()
267
    {
268 1
        return $this->position;
269
    }
270
271
    /**
272
     * Set points
273
     *
274
     * @param integer $points
275
     *
276
     * @return TablePosition
277
     */
278 1
    public function setPoints($points)
279
    {
280 1
        $this->points = $points;
281
282 1
        return $this;
283
    }
284
285
    /**
286
     * Get points
287
     *
288
     * @return integer
289
     */
290 1
    public function getPoints()
291
    {
292 1
        return $this->points;
293
    }
294
295
    /**
296
     * Set pointsAway
297
     *
298
     * @param integer $pointsAway
299
     *
300
     * @return TablePosition
301
     */
302 1
    public function setPointsAway($pointsAway)
303
    {
304 1
        $this->pointsAway = $pointsAway;
305
306 1
        return $this;
307
    }
308
309
    /**
310
     * Get pointsAway
311
     *
312
     * @return integer
313
     */
314 1
    public function getPointsAway()
315
    {
316 1
        return $this->pointsAway;
317
    }
318
319
    /**
320
     * Set pointsHome
321
     *
322
     * @param integer $pointsHome
323
     *
324
     * @return TablePosition
325
     */
326 1
    public function setPointsHome($pointsHome)
327
    {
328 1
        $this->pointsHome = $pointsHome;
329
330 1
        return $this;
331
    }
332
333
    /**
334
     * Get pointsHome
335
     *
336
     * @return integer
337
     */
338 1
    public function getPointsHome()
339
    {
340 1
        return $this->pointsHome;
341
    }
342
343
    /**
344
     * Set wins
345
     *
346
     * @param integer $wins
347
     *
348
     * @return TablePosition
349
     */
350 1
    public function setWins($wins)
351
    {
352 1
        $this->wins = $wins;
353
354 1
        return $this;
355
    }
356
357
    /**
358
     * Get wins
359
     *
360
     * @return integer
361
     */
362 1
    public function getWins()
363
    {
364 1
        return $this->wins;
365
    }
366
367
    /**
368
     * Set winsAway
369
     *
370
     * @param integer $winsAway
371
     *
372
     * @return TablePosition
373
     */
374 1
    public function setWinsAway($winsAway)
375
    {
376 1
        $this->winsAway = $winsAway;
377
378 1
        return $this;
379
    }
380
381
    /**
382
     * Get winsAway
383
     *
384
     * @return integer
385
     */
386 1
    public function getWinsAway()
387
    {
388 1
        return $this->winsAway;
389
    }
390
391
    /**
392
     * Set winsHome
393
     *
394
     * @param integer $winsHome
395
     *
396
     * @return TablePosition
397
     */
398 1
    public function setWinsHome($winsHome)
399
    {
400 1
        $this->winsHome = $winsHome;
401
402 1
        return $this;
403
    }
404
405
    /**
406
     * Get winsHome
407
     *
408
     * @return integer
409
     */
410 1
    public function getWinsHome()
411
    {
412 1
        return $this->winsHome;
413
    }
414
415
    /**
416
     * Set losses
417
     *
418
     * @param integer $losses
419
     *
420
     * @return TablePosition
421
     */
422 1
    public function setLosses($losses)
423
    {
424 1
        $this->losses = $losses;
425
426 1
        return $this;
427
    }
428
429
    /**
430
     * Get losses
431
     *
432
     * @return integer
433
     */
434 1
    public function getLosses()
435
    {
436 1
        return $this->losses;
437
    }
438
439
    /**
440
     * Set lossesAway
441
     *
442
     * @param integer $lossesAway
443
     *
444
     * @return TablePosition
445
     */
446 1
    public function setLossesAway($lossesAway)
447
    {
448 1
        $this->lossesAway = $lossesAway;
449
450 1
        return $this;
451
    }
452
453
    /**
454
     * Get lossesAway
455
     *
456
     * @return integer
457
     */
458 1
    public function getLossesAway()
459
    {
460 1
        return $this->lossesAway;
461
    }
462
463
    /**
464
     * Set lossesHome
465
     *
466
     * @param integer $lossesHome
467
     *
468
     * @return TablePosition
469
     */
470 1
    public function setLossesHome($lossesHome)
471
    {
472 1
        $this->lossesHome = $lossesHome;
473
474 1
        return $this;
475
    }
476
477
    /**
478
     * Get lossesHome
479
     *
480
     * @return integer
481
     */
482 1
    public function getLossesHome()
483
    {
484 1
        return $this->lossesHome;
485
    }
486
487
    /**
488
     * Set draws
489
     *
490
     * @param integer $draws
491
     *
492
     * @return TablePosition
493
     */
494 1
    public function setDraws($draws)
495
    {
496 1
        $this->draws = $draws;
497
498 1
        return $this;
499
    }
500
501
    /**
502
     * Get draws
503
     *
504
     * @return integer
505
     */
506 1
    public function getDraws()
507
    {
508 1
        return $this->draws;
509
    }
510
511
    /**
512
     * Set drawsAway
513
     *
514
     * @param integer $drawsAway
515
     *
516
     * @return TablePosition
517
     */
518 1
    public function setDrawsAway($drawsAway)
519
    {
520 1
        $this->drawsAway = $drawsAway;
521
522 1
        return $this;
523
    }
524
525
    /**
526
     * Get drawsAway
527
     *
528
     * @return integer
529
     */
530 1
    public function getDrawsAway()
531
    {
532 1
        return $this->drawsAway;
533
    }
534
535
    /**
536
     * Set drawsHome
537
     *
538
     * @param integer $drawsHome
539
     *
540
     * @return TablePosition
541
     */
542 1
    public function setDrawsHome($drawsHome)
543
    {
544 1
        $this->drawsHome = $drawsHome;
545
546 1
        return $this;
547
    }
548
549
    /**
550
     * Get drawsHome
551
     *
552
     * @return integer
553
     */
554 1
    public function getDrawsHome()
555
    {
556 1
        return $this->drawsHome;
557
    }
558
559
    /**
560
     * Set goals
561
     *
562
     * @param integer $goals
563
     *
564
     * @return TablePosition
565
     */
566 1
    public function setGoals($goals)
567
    {
568 1
        $this->goals = $goals;
569
570 1
        return $this;
571
    }
572
573
    /**
574
     * Get goals
575
     *
576
     * @return integer
577
     */
578 1
    public function getGoals()
579
    {
580 1
        return $this->goals;
581
    }
582
583
    /**
584
     * Set goalsAway
585
     *
586
     * @param integer $goalsAway
587
     *
588
     * @return TablePosition
589
     */
590 1
    public function setGoalsAway($goalsAway)
591
    {
592 1
        $this->goalsAway = $goalsAway;
593
594 1
        return $this;
595
    }
596
597
    /**
598
     * Get goalsAway
599
     *
600
     * @return integer
601
     */
602 1
    public function getGoalsAway()
603
    {
604 1
        return $this->goalsAway;
605
    }
606
607
    /**
608
     * Set goalsHome
609
     *
610
     * @param integer $goalsHome
611
     *
612
     * @return TablePosition
613
     */
614 1
    public function setGoalsHome($goalsHome)
615
    {
616 1
        $this->goalsHome = $goalsHome;
617
618 1
        return $this;
619
    }
620
621
    /**
622
     * Get goalsHome
623
     *
624
     * @return integer
625
     */
626 1
    public function getGoalsHome()
627
    {
628 1
        return $this->goalsHome;
629
    }
630
631
    /**
632
     * Set goalsAgainst
633
     *
634
     * @param integer $goalsAgainst
635
     *
636
     * @return TablePosition
637
     */
638 1
    public function setGoalsAgainst($goalsAgainst)
639
    {
640 1
        $this->goalsAgainst = $goalsAgainst;
641
642 1
        return $this;
643
    }
644
645
    /**
646
     * Get goalsAgainst
647
     *
648
     * @return integer
649
     */
650 1
    public function getGoalsAgainst()
651
    {
652 1
        return $this->goalsAgainst;
653
    }
654
655
    /**
656
     * Set goalsAgainstAway
657
     *
658
     * @param integer $goalsAgainstAway
659
     *
660
     * @return TablePosition
661
     */
662 1
    public function setGoalsAgainstAway($goalsAgainstAway)
663
    {
664 1
        $this->goalsAgainstAway = $goalsAgainstAway;
665
666 1
        return $this;
667
    }
668
669
    /**
670
     * Get goalsAgainstAway
671
     *
672
     * @return integer
673
     */
674 1
    public function getGoalsAgainstAway()
675
    {
676 1
        return $this->goalsAgainstAway;
677
    }
678
679
    /**
680
     * Set goalsAgainstHome
681
     *
682
     * @param integer $goalsAgainstHome
683
     *
684
     * @return TablePosition
685
     */
686 1
    public function setGoalsAgainstHome($goalsAgainstHome)
687
    {
688 1
        $this->goalsAgainstHome = $goalsAgainstHome;
689
690 1
        return $this;
691
    }
692
693
    /**
694
     * Get goalsAgainstHome
695
     *
696
     * @return integer
697
     */
698 1
    public function getGoalsAgainstHome()
699
    {
700 1
        return $this->goalsAgainstHome;
701
    }
702
703
    /**
704
     * Set goalDifference
705
     *
706
     * @param integer $goalDifference
707
     *
708
     * @return TablePosition
709
     */
710 1
    public function setGoalDifference($goalDifference)
711
    {
712 1
        $this->goalDifference = $goalDifference;
713
714 1
        return $this;
715
    }
716
717
    /**
718
     * Get goalDifference
719
     *
720
     * @return integer
721
     */
722 1
    public function getGoalDifference()
723
    {
724 1
        return $this->goalDifference;
725
    }
726
727
    /**
728
     * Set goalDifferenceAway
729
     *
730
     * @param integer $goalDifferenceAway
731
     *
732
     * @return TablePosition
733
     */
734 1
    public function setGoalDifferenceAway($goalDifferenceAway)
735
    {
736 1
        $this->goalDifferenceAway = $goalDifferenceAway;
737
738 1
        return $this;
739
    }
740
741
    /**
742
     * Get goalDifferenceAway
743
     *
744
     * @return integer
745
     */
746 1
    public function getGoalDifferenceAway()
747
    {
748 1
        return $this->goalDifferenceAway;
749
    }
750
751
    /**
752
     * Set goalDifferenceHome
753
     *
754
     * @param integer $goalDifferenceHome
755
     *
756
     * @return TablePosition
757
     */
758 1
    public function setGoalDifferenceHome($goalDifferenceHome)
759
    {
760 1
        $this->goalDifferenceHome = $goalDifferenceHome;
761
762 1
        return $this;
763
    }
764
765
    /**
766
     * Get goalDifferenceHome
767
     *
768
     * @return integer
769
     */
770 1
    public function getGoalDifferenceHome()
771
    {
772 1
        return $this->goalDifferenceHome;
773
    }
774
775
    /**
776
     * Set createdAt
777
     *
778
     * @param \DateTime $createdAt
779
     *
780
     * @return TablePosition
781
     */
782 1
    public function setCreatedAt($createdAt)
783
    {
784 1
        $this->createdAt = $createdAt;
785
786 1
        return $this;
787
    }
788
789
    /**
790
     * Get createdAt
791
     *
792
     * @return \DateTime
793
     */
794 1
    public function getCreatedAt()
795
    {
796 1
        return $this->createdAt;
797
    }
798
799
    /**
800
     * Set updatedAt
801
     *
802
     * @param \DateTime $updatedAt
803
     *
804
     * @return TablePosition
805
     */
806 1
    public function setUpdatedAt($updatedAt)
807
    {
808 1
        $this->updatedAt = $updatedAt;
809
810 1
        return $this;
811
    }
812
813
    /**
814
     * Get updatedAt
815
     *
816
     * @return \DateTime
817
     */
818 1
    public function getUpdatedAt()
819
    {
820 1
        return $this->updatedAt;
821
    }
822
823
    /**
824
     * Set team
825
     *
826
     * @param \Torakel\DatabaseBundle\Entity\Team $team
827
     *
828
     * @return TablePosition
829
     */
830 1
    public function setTeam(\Torakel\DatabaseBundle\Entity\Team $team = null)
831
    {
832 1
        $this->team = $team;
833
834 1
        return $this;
835
    }
836
837
    /**
838
     * Get team
839
     *
840
     * @return \Torakel\DatabaseBundle\Entity\Team
841
     */
842 1
    public function getTeam()
843
    {
844 1
        return $this->team;
845
    }
846
847
    /**
848
     * Set gamesPlayed
849
     *
850
     * @param integer $gamesPlayed
851
     *
852
     * @return TablePosition
853
     */
854 1
    public function setGamesPlayed($gamesPlayed)
855
    {
856 1
        $this->gamesPlayed = $gamesPlayed;
857
858 1
        return $this;
859
    }
860
861
    /**
862
     * Get gamesPlayed
863
     *
864
     * @return integer
865
     */
866 1
    public function getGamesPlayed()
867
    {
868 1
        return $this->gamesPlayed;
869
    }
870
871
    /**
872
     * Set matchdayTable
873
     *
874
     * @param \Torakel\DatabaseBundle\Entity\MatchdayTable $matchdayTable
875
     *
876
     * @return TablePosition
877
     */
878 1
    public function setMatchdayTable(\Torakel\DatabaseBundle\Entity\MatchdayTable $matchdayTable = null)
879
    {
880 1
        $this->matchdayTable = $matchdayTable;
881
882 1
        return $this;
883
    }
884
885
    /**
886
     * Get matchdayTable
887
     *
888
     * @return \Torakel\DatabaseBundle\Entity\MatchdayTable
889
     */
890 1
    public function getMatchdayTable()
891
    {
892 1
        return $this->matchdayTable;
893
    }
894
}
895