Event   A
last analyzed

Complexity

Total Complexity 32

Size/Duplication

Total Lines 200
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 3
Bugs 1 Features 1
Metric Value
wmc 32
c 3
b 1
f 1
lcom 1
cbo 1
dl 0
loc 200
rs 9.6

29 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 1
A getUri() 0 4 1
A setUri() 0 4 1
A getName() 0 4 1
A setName() 0 4 1
A getDescription() 0 4 1
A setDescription() 0 4 1
A getAddress() 0 4 1
A setAddress() 0 4 1
A getMapUrl() 0 4 1
A setMapUrl() 0 4 1
A getSeries() 0 4 1
A setSeries() 0 4 1
A getStart() 0 4 1
A setStart() 0 4 1
A getEnd() 0 4 1
A setEnd() 0 4 1
A getLocation() 0 4 1
A setLocation() 0 4 1
A getSessions() 0 4 1
A setSessions() 0 15 4
A getConfirmedAttendees() 0 4 1
A setConfirmedAttendees() 0 4 1
A getUnconfirmedAttendees() 0 4 1
A setUnconfirmedAttendees() 0 4 1
A getComments() 0 4 1
A setComments() 0 4 1
A getPolls() 0 4 1
A setPolls() 0 4 1
1
<?php
2
3
/*
4
 * This is part of the webuni/srazy-api-client.
5
 *
6
 * (c) Martin Hasoň <[email protected]>
7
 * (c) Webuni s.r.o. <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace Webuni\Srazy\Model;
14
15
use Doctrine\Common\Collections\ArrayCollection;
16
17
class Event
18
{
19
    private $uri;
20
21
    private $name;
22
23
    private $description;
24
25
    private $series;
26
27
    private $sessions;
28
29
    private $start;
30
31
    private $end;
32
33
    private $address;
34
35
    private $mapUrl;
36
37
    private $confirmedAttendees;
38
39
    private $unconfirmedAttendees;
40
41
    private $comments;
42
43
    private $location;
44
45
    private $polls;
46
47
    public function __construct($name = null, $uri = null, \DateTime $date = null)
48
    {
49
        $this->name = $name;
50
        $this->uri = $uri;
51
        $this->start = $date;
52
        $this->series = new ArrayCollection();
53
        $this->sessions = new ArrayCollection();
54
        $this->comments = new ArrayCollection();
55
        $this->polls = new ArrayCollection();
56
        $this->confirmedAttendees = new ArrayCollection();
57
        $this->unconfirmedAttendees = new ArrayCollection();
58
    }
59
60
    public function getUri()
61
    {
62
        return $this->uri;
63
    }
64
65
    public function setUri($uri)
66
    {
67
        $this->uri = $uri;
68
    }
69
70
    public function getName()
71
    {
72
        return $this->name;
73
    }
74
75
    public function setName($name)
76
    {
77
        $this->name = $name;
78
    }
79
80
    public function getDescription()
81
    {
82
        return $this->description;
83
    }
84
85
    public function setDescription($description)
86
    {
87
        $this->description = $description;
88
    }
89
90
    public function getAddress()
91
    {
92
        return $this->address;
93
    }
94
95
    public function setAddress($address)
96
    {
97
        $this->address = $address;
98
    }
99
100
    public function getMapUrl()
101
    {
102
        return $this->mapUrl;
103
    }
104
105
    public function setMapUrl($mapUrl)
106
    {
107
        $this->mapUrl = $mapUrl;
108
    }
109
110
    public function getSeries()
111
    {
112
        return $this->series;
113
    }
114
115
    public function setSeries(Series $series = null)
116
    {
117
        $this->series = $series;
118
    }
119
120
    public function getStart()
121
    {
122
        return $this->start;
123
    }
124
125
    public function setStart(\DateTime $start = null)
126
    {
127
        $this->start = $start;
128
    }
129
130
    public function getEnd()
131
    {
132
        return $this->end;
133
    }
134
135
    public function setEnd(\DateTime $end = null)
136
    {
137
        $this->end = $end;
138
    }
139
140
    public function getLocation()
141
    {
142
        return $this->location;
143
    }
144
145
    public function setLocation($location)
146
    {
147
        $this->location = $location;
148
    }
149
150
    public function getSessions()
151
    {
152
        return $this->sessions;
153
    }
154
155
    /**
156
     * @param Session[]|ArrayCollection $sessions
157
     */
158
    public function setSessions(ArrayCollection $sessions)
159
    {
160
        $this->sessions = $sessions;
161
162
        if (null !== $this->end) {
163
            return;
164
        }
165
166
        foreach ($sessions as $session) {
167
            if ($session->isType(Session::TYPE_END)) {
168
                $this->setEnd($session->getStart());
169
                break;
170
            }
171
        }
172
    }
173
174
    public function getConfirmedAttendees()
175
    {
176
        return $this->confirmedAttendees;
177
    }
178
179
    public function setConfirmedAttendees(ArrayCollection $confirmedAttendees)
180
    {
181
        $this->confirmedAttendees = $confirmedAttendees;
182
    }
183
184
    public function getUnconfirmedAttendees()
185
    {
186
        return $this->unconfirmedAttendees;
187
    }
188
189
    public function setUnconfirmedAttendees(ArrayCollection $unconfirmedAttendees)
190
    {
191
        $this->unconfirmedAttendees = $unconfirmedAttendees;
192
    }
193
194
    public function getComments()
195
    {
196
        return $this->comments;
197
    }
198
199
    public function setComments(ArrayCollection $comments)
200
    {
201
        $this->comments = $comments;
202
    }
203
204
    /**
205
     * @return Poll[]|ArrayCollection
206
     */
207
    public function getPolls()
208
    {
209
        return $this->polls;
210
    }
211
212
    public function setPolls(ArrayCollection $polls)
213
    {
214
        $this->polls = $polls;
215
    }
216
}
217