Completed
Push — master ( 215596...154eb7 )
by Martin
03:32
created

Event::setSessions()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 15
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 15
rs 9.2
cc 4
eloc 8
nc 4
nop 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
    public function __construct($name = null, $uri = null, \DateTime $date = null)
46
    {
47
        $this->name = $name;
48
        $this->uri = $uri;
49
        $this->start = $date;
50
    }
51
52
    public function getUri()
53
    {
54
        return $this->uri;
55
    }
56
57
    public function setUri($uri)
58
    {
59
        $this->uri = $uri;
60
    }
61
62
    public function getName()
63
    {
64
        return $this->name;
65
    }
66
67
    public function setName($name)
68
    {
69
        $this->name = $name;
70
    }
71
72
    public function getDescription()
73
    {
74
        return $this->description;
75
    }
76
77
    public function setDescription($description)
78
    {
79
        $this->description = $description;
80
    }
81
82
    public function getAddress()
83
    {
84
        return $this->address;
85
    }
86
87
    public function setAddress($address)
88
    {
89
        $this->address = $address;
90
    }
91
92
    public function getMapUrl()
93
    {
94
        return $this->mapUrl;
95
    }
96
97
    public function setMapUrl($mapUrl)
98
    {
99
        $this->mapUrl = $mapUrl;
100
    }
101
102
    public function getSeries()
103
    {
104
        return $this->series;
105
    }
106
107
    public function setSeries(Series $series = null)
108
    {
109
        $this->series = $series;
110
    }
111
112
    public function getStart()
113
    {
114
        return $this->start;
115
    }
116
117
    public function setStart(\DateTime $start = null)
118
    {
119
        $this->start = $start;
120
    }
121
122
    public function getEnd()
123
    {
124
        return $this->end;
125
    }
126
127
    public function setEnd(\DateTime $end = null)
128
    {
129
        $this->end = $end;
130
    }
131
132
    public function getLocation()
133
    {
134
        return $this->location;
135
    }
136
137
    public function setLocation($location)
138
    {
139
        $this->location = $location;
140
    }
141
142
    public function getSessions()
143
    {
144
        return $this->sessions;
145
    }
146
147
    /**
148
     * @param Session[]|ArrayCollection $sessions
149
     */
150
    public function setSessions(ArrayCollection $sessions)
151
    {
152
        $this->sessions = $sessions;
153
154
        if (null !== $this->end) {
155
            return;
156
        }
157
158
        foreach ($sessions as $session) {
159
            if ($session->isType(Session::TYPE_END)) {
160
                $this->setEnd($session->getStart());
161
                break;
162
            }
163
        }
164
    }
165
166
    public function getConfirmedAttendees()
167
    {
168
        return $this->confirmedAttendees;
169
    }
170
171
    public function setConfirmedAttendees(ArrayCollection $confirmedAttendees)
172
    {
173
        $this->confirmedAttendees = $confirmedAttendees;
174
    }
175
176
    public function getUnconfirmedAttendees()
177
    {
178
        return $this->unconfirmedAttendees;
179
    }
180
181
    public function setUnconfirmedAttendees(ArrayCollection $unconfirmedAttendees)
182
    {
183
        $this->unconfirmedAttendees = $unconfirmedAttendees;
184
    }
185
186
    public function getComments()
187
    {
188
        return $this->comments;
189
    }
190
191
    public function setComments(ArrayCollection $comments)
192
    {
193
        $this->comments = $comments;
194
    }
195
}
196