IRCServer   A
last analyzed

Complexity

Total Complexity 19

Size/Duplication

Total Lines 252
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 3

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 19
c 3
b 0
f 0
lcom 2
cbo 3
dl 0
loc 252
rs 10

19 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 4 1
A __construct() 0 5 1
A getId() 0 4 1
A setName() 0 6 1
A getName() 0 4 1
A setHost() 0 6 1
A getHost() 0 4 1
A setPort() 0 6 1
A getPort() 0 4 1
A setPortSsl() 0 6 1
A getPortSsl() 0 4 1
A setWebsite() 0 6 1
A getWebsite() 0 4 1
A addTeam() 0 6 1
A removeTeam() 0 4 1
A getTeams() 0 4 1
A addXdccname() 0 6 1
A removeXdccname() 0 4 1
A getXdccnames() 0 4 1
1
<?php
2
3
namespace Xdaysaysay\CoreBundle\Entity;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
use Doctrine\ORM\Mapping as ORM;
7
use Gedmo\Blameable\Traits\BlameableEntity;
8
use Gedmo\Mapping\Annotation as Gedmo;
9
use Gedmo\Timestampable\Traits\TimestampableEntity;
10
11
/**
12
 * @ORM\Entity
13
 * @ORM\Table(name="irc_server")
14
 */
15
class IRCServer
16
{
17
    use TimestampableEntity;
18
    use BlameableEntity;
19
20
    /**
21
     * @ORM\Id
22
     * @ORM\Column(type="integer", options={"unsigned"=true})
23
     * @ORM\GeneratedValue(strategy="AUTO")
24
     */
25
    protected $id;
26
27
    /**
28
     * @ORM\Column(type="string", length=255)
29
     */
30
    protected $name;
31
32
    /**
33
     * @ORM\OneToMany(targetEntity="Xdaysaysay\CoreBundle\Entity\Team", mappedBy="ircServer")
34
     */
35
    protected $teams;
36
37
    /**
38
     * @ORM\OneToMany(targetEntity="Xdaysaysay\CoreBundle\Entity\XdccName", mappedBy="ircServer")
39
     */
40
    protected $xdccnames;
41
42
    /**
43
     * @ORM\Column(type="string", length=255)
44
     */
45
    protected $host;
46
47
    /**
48
     * @ORM\Column(type="integer", options={"unsigned"=true})
49
     */
50
    protected $port;
51
52
    /**
53
     * @ORM\Column(type="integer", nullable=true, options={"unsigned"=true})
54
     */
55
    protected $port_ssl;
56
57
    /**
58
     * @ORM\Column(type="string", nullable=true, length=255)
59
     */
60
    protected $website;
61
62
    public function __toString()
63
    {
64
        return $this->getName();
65
    }
66
67
    /**
68
     * Constructor
69
     */
70
    public function __construct()
71
    {
72
        $this->teams = new ArrayCollection();
73
        $this->xdccnames = new ArrayCollection();
74
    }
75
76
    /**
77
     * Get id
78
     *
79
     * @return integer
80
     */
81
    public function getId()
82
    {
83
        return $this->id;
84
    }
85
86
    /**
87
     * Set name
88
     *
89
     * @param string $name
90
     * @return IRCServer
91
     */
92
    public function setName($name)
93
    {
94
        $this->name = $name;
95
96
        return $this;
97
    }
98
99
    /**
100
     * Get name
101
     *
102
     * @return string
103
     */
104
    public function getName()
105
    {
106
        return $this->name;
107
    }
108
109
    /**
110
     * Set host
111
     *
112
     * @param string $host
113
     * @return IRCServer
114
     */
115
    public function setHost($host)
116
    {
117
        $this->host = $host;
118
119
        return $this;
120
    }
121
122
    /**
123
     * Get host
124
     *
125
     * @return string
126
     */
127
    public function getHost()
128
    {
129
        return $this->host;
130
    }
131
132
    /**
133
     * Set port
134
     *
135
     * @param integer $port
136
     * @return IRCServer
137
     */
138
    public function setPort($port)
139
    {
140
        $this->port = $port;
141
142
        return $this;
143
    }
144
145
    /**
146
     * Get port
147
     *
148
     * @return integer
149
     */
150
    public function getPort()
151
    {
152
        return $this->port;
153
    }
154
155
    /**
156
     * Set port_ssl
157
     *
158
     * @param integer $portSsl
159
     * @return IRCServer
160
     */
161
    public function setPortSsl($portSsl)
162
    {
163
        $this->port_ssl = $portSsl;
164
165
        return $this;
166
    }
167
168
    /**
169
     * Get port_ssl
170
     *
171
     * @return integer
172
     */
173
    public function getPortSsl()
174
    {
175
        return $this->port_ssl;
176
    }
177
178
    /**
179
     * Set website
180
     *
181
     * @param string $website
182
     * @return IRCServer
183
     */
184
    public function setWebsite($website)
185
    {
186
        $this->website = $website;
187
188
        return $this;
189
    }
190
191
    /**
192
     * Get website
193
     *
194
     * @return string
195
     */
196
    public function getWebsite()
197
    {
198
        return $this->website;
199
    }
200
201
    /**
202
     * Add teams
203
     *
204
     * @param Team $teams
205
     * @return IRCServer
206
     */
207
    public function addTeam(Team $teams)
208
    {
209
        $this->teams[] = $teams;
210
211
        return $this;
212
    }
213
214
    /**
215
     * Remove teams
216
     *
217
     * @param Team $teams
218
     */
219
    public function removeTeam(Team $teams)
220
    {
221
        $this->teams->removeElement($teams);
222
    }
223
224
    /**
225
     * Get teams
226
     *
227
     * @return ArrayCollection|Team[]
228
     */
229
    public function getTeams()
230
    {
231
        return $this->teams;
232
    }
233
234
    /**
235
     * Add xdccnames
236
     *
237
     * @param XdccName $xdccnames
238
     * @return IRCServer
239
     */
240
    public function addXdccname(XdccName $xdccnames)
241
    {
242
        $this->xdccnames[] = $xdccnames;
243
244
        return $this;
245
    }
246
247
    /**
248
     * Remove xdccnames
249
     *
250
     * @param XdccName $xdccnames
251
     */
252
    public function removeXdccname(XdccName $xdccnames)
253
    {
254
        $this->xdccnames->removeElement($xdccnames);
255
    }
256
257
    /**
258
     * Get xdccnames
259
     *
260
     * @return ArrayCollection|XdccName[]
261
     */
262
    public function getXdccnames()
263
    {
264
        return $this->xdccnames;
265
    }
266
}
267