Xdcc   A
last analyzed

Complexity

Total Complexity 25

Size/Duplication

Total Lines 350
Duplicated Lines 0 %

Coupling/Cohesion

Components 3
Dependencies 3

Importance

Changes 4
Bugs 0 Features 2
Metric Value
wmc 25
c 4
b 0
f 2
lcom 3
cbo 3
dl 0
loc 350
rs 10

25 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getId() 0 4 1
A setUrl() 0 6 1
A getUrl() 0 4 1
A setDiskspace() 0 6 1
A getDiskspace() 0 4 1
A setTransferedtotal() 0 6 1
A getTransferedtotal() 0 4 1
A setTotaluptime() 0 6 1
A getTotaluptime() 0 4 1
A setLastupdate() 0 6 1
A getLastupdate() 0 4 1
A setVisible() 0 6 1
A getVisible() 0 4 1
A setServer() 0 6 1
A getServer() 0 4 1
A addPack() 0 6 1
A removePack() 0 4 1
A getPacks() 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(repositoryClass="Xdaysaysay\CoreBundle\Entity\Repository\XdccRepository");
13
 * @ORM\Table(name="xdcc")
14
 */
15
class Xdcc
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\ManyToOne(targetEntity="Xdaysaysay\CoreBundle\Entity\Server", inversedBy="xdccs")
29
     * @ORM\JoinColumn(name="id_server", referencedColumnName="id", nullable=false)
30
     */
31
    protected $server;
32
33
    /**
34
     * @ORM\OneToMany(targetEntity="Xdaysaysay\CoreBundle\Entity\Pack", mappedBy="xdcc", cascade={"all"}, orphanRemoval=true)
35
     * @ORM\JoinColumn(name="id_xdcc", referencedColumnName="id")
36
     */
37
    protected $packs;
38
39
    /**
40
     * @ORM\ManyToMany(targetEntity="Xdaysaysay\CoreBundle\Entity\Team", inversedBy="xdccs")
41
     * @ORM\JoinTable(name="team_xdcc",
42
     *      joinColumns={@ORM\JoinColumn(name="id_xdcc", referencedColumnName="id", nullable=false)},
43
     *      inverseJoinColumns={@ORM\JoinColumn(name="id_team", referencedColumnName="id", nullable=false)}
44
     *      )
45
     **/
46
    protected $teams;
47
48
    /**
49
     * @ORM\OneToMany(targetEntity="Xdaysaysay\CoreBundle\Entity\XdccName", mappedBy="xdcc", cascade={"all"}, orphanRemoval=true)
50
     */
51
    protected $xdccnames;
52
53
    /**
54
     * @ORM\Column(type="string", length=255)
55
     */
56
    protected $url;
57
58
    /**
59
     * @ORM\Column(type="string", nullable=true, options={"unsigned"=true})
60
     */
61
    protected $diskspace;
62
63
    /**
64
     * @ORM\Column(type="string", nullable=true, options={"unsigned"=true})
65
     */
66
    protected $transferedtotal;
67
68
    /**
69
     * @ORM\Column(type="integer", nullable=true, options={"unsigned"=true})
70
     */
71
    protected $totaluptime;
72
73
    /**
74
     * @ORM\Column(type="datetime", nullable=true)
75
     */
76
    protected $lastupdate;
77
78
    /**
79
     * @ORM\Column(type="boolean")
80
     */
81
    protected $visible = true;
82
83
    /**
84
     * Constructor
85
     */
86
    public function __construct()
87
    {
88
        $this->teams = new ArrayCollection();
89
        $this->xdccnames = new ArrayCollection();
90
        $this->packs = new ArrayCollection();
91
    }
92
93
    /**
94
     * Get id
95
     *
96
     * @return integer
97
     */
98
    public function getId()
99
    {
100
        return $this->id;
101
    }
102
103
    /**
104
     * Set url
105
     *
106
     * @param string $url
107
     * @return Xdcc
108
     */
109
    public function setUrl($url)
110
    {
111
        $this->url = $url;
112
113
        return $this;
114
    }
115
116
    /**
117
     * Get url
118
     *
119
     * @return string
120
     */
121
    public function getUrl()
122
    {
123
        return $this->url;
124
    }
125
126
    /**
127
     * Set diskspace
128
     *
129
     * @param integer $diskspace
130
     * @return Xdcc
131
     */
132
    public function setDiskspace($diskspace)
133
    {
134
        $this->diskspace = $diskspace;
135
136
        return $this;
137
    }
138
139
    /**
140
     * Get diskspace
141
     *
142
     * @return integer
143
     */
144
    public function getDiskspace()
145
    {
146
        return $this->diskspace;
147
    }
148
149
    /**
150
     * Set transferedtotal
151
     *
152
     * @param integer $transferedtotal
153
     * @return Xdcc
154
     */
155
    public function setTransferedtotal($transferedtotal)
156
    {
157
        $this->transferedtotal = $transferedtotal;
158
159
        return $this;
160
    }
161
162
    /**
163
     * Get transferedtotal
164
     *
165
     * @return integer
166
     */
167
    public function getTransferedtotal()
168
    {
169
        return $this->transferedtotal;
170
    }
171
172
    /**
173
     * Set totaluptime
174
     *
175
     * @param integer $totaluptime
176
     * @return Xdcc
177
     */
178
    public function setTotaluptime($totaluptime)
179
    {
180
        $this->totaluptime = $totaluptime;
181
182
        return $this;
183
    }
184
185
    /**
186
     * Get totaluptime
187
     *
188
     * @return integer
189
     */
190
    public function getTotaluptime()
191
    {
192
        return $this->totaluptime;
193
    }
194
195
    /**
196
     * Set lastupdate
197
     *
198
     * @param \DateTime $lastupdate
199
     * @return Xdcc
200
     */
201
    public function setLastupdate($lastupdate)
202
    {
203
        $this->lastupdate = $lastupdate;
204
205
        return $this;
206
    }
207
208
    /**
209
     * Get lastupdate
210
     *
211
     * @return \DateTime
212
     */
213
    public function getLastupdate()
214
    {
215
        return $this->lastupdate;
216
    }
217
218
    /**
219
     * Set visible
220
     *
221
     * @param boolean $visible
222
     * @return Xdcc
223
     */
224
    public function setVisible($visible)
225
    {
226
        $this->visible = $visible;
227
228
        return $this;
229
    }
230
231
    /**
232
     * Get visible
233
     *
234
     * @return boolean
235
     */
236
    public function getVisible()
237
    {
238
        return $this->visible;
239
    }
240
241
    /**
242
     * Set server
243
     *
244
     * @param Server $server
245
     * @return Xdcc
246
     */
247
    public function setServer(Server $server = null)
248
    {
249
        $this->server = $server;
250
251
        return $this;
252
    }
253
254
    /**
255
     * Get server
256
     *
257
     * @return Server
258
     */
259
    public function getServer()
260
    {
261
        return $this->server;
262
    }
263
264
    /**
265
     * Add packs
266
     *
267
     * @param Pack $packs
268
     * @return Xdcc
269
     */
270
    public function addPack(Pack $packs)
271
    {
272
        $this->packs[] = $packs;
273
274
        return $this;
275
    }
276
277
    /**
278
     * Remove packs
279
     *
280
     * @param Pack $packs
281
     */
282
    public function removePack(Pack $packs)
283
    {
284
        $this->packs->removeElement($packs);
285
    }
286
287
    /**
288
     * Get packs
289
     *
290
     * @return ArrayCollection|Pack[]
291
     */
292
    public function getPacks()
293
    {
294
        return $this->packs;
295
    }
296
297
    /**
298
     * Add team
299
     *
300
     * @param Team $team
301
     *
302
     * @return Xdcc
303
     */
304
    public function addTeam(Team $team)
305
    {
306
        $this->teams[] = $team;
307
308
        return $this;
309
    }
310
311
    /**
312
     * Remove team
313
     *
314
     * @param Team $team
315
     */
316
    public function removeTeam(Team $team)
317
    {
318
        $this->teams->removeElement($team);
319
    }
320
321
    /**
322
     * Get teams
323
     *
324
     * @return ArrayCollection|Team[]
325
     */
326
    public function getTeams()
327
    {
328
        return $this->teams;
329
    }
330
331
    /**
332
     * Add xdccname
333
     *
334
     * @param XdccName $xdccname
335
     *
336
     * @return Xdcc
337
     */
338
    public function addXdccname(XdccName $xdccname)
339
    {
340
        $this->xdccnames[] = $xdccname;
341
342
        return $this;
343
    }
344
345
    /**
346
     * Remove xdccname
347
     *
348
     * @param XdccName $xdccname
349
     */
350
    public function removeXdccname(XdccName $xdccname)
351
    {
352
        $this->xdccnames->removeElement($xdccname);
353
    }
354
355
    /**
356
     * Get xdccnames
357
     *
358
     * @return XdccName[]
359
     */
360
    public function getXdccnames()
361
    {
362
        return $this->xdccnames;
363
    }
364
}
365