Media   A
last analyzed

Complexity

Total Complexity 20

Size/Duplication

Total Lines 294
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 20
lcom 1
cbo 0
dl 0
loc 294
rs 10
c 3
b 0
f 0

20 Methods

Rating   Name   Duplication   Size   Complexity  
A getDateCreated() 0 4 1
A setDateCreated() 0 6 1
A getDateUpdated() 0 4 1
A setDateUpdated() 0 6 1
A getCreatedFromIp() 0 4 1
A setCreatedFromIp() 0 6 1
A __construct() 0 3 1
A getFolder() 0 4 1
A getId() 0 4 1
A setId() 0 6 1
A getName() 0 4 1
A setName() 0 6 1
A getUri() 0 4 1
A setUri() 0 6 1
A getSecretKey() 0 4 1
A setSecretKey() 0 6 1
A getMime() 0 4 1
A setMime() 0 6 1
A getLifetime() 0 4 1
A setLifetime() 0 6 1
1
<?php
2
3
namespace Alpixel\Bundle\MediaBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Gedmo\Mapping\Annotation as Gedmo;
7
8
/**
9
 * Media.
10
 *
11
 * @ORM\Table(name="media")
12
 * @ORM\Entity(repositoryClass="Alpixel\Bundle\MediaBundle\Repository\MediaRepository")
13
 */
14
class Media
15
{
16
    /**
17
     * @var int
18
     *
19
     * @ORM\Column(name="media_id", type="integer", nullable=false)
20
     * @ORM\Id
21
     * @ORM\GeneratedValue(strategy="IDENTITY")
22
     */
23
    protected $id;
24
25
    /**
26
     * @var string
27
     *
28
     * @ORM\Column(name="name", type="string", length=191, nullable=false)
29
     */
30
    protected $name;
31
32
    /**
33
     * @var string
34
     *
35
     * @ORM\Column(name="uri", type="string", length=191, nullable=false, unique=true)
36
     */
37
    protected $uri;
38
39
    /**
40
     * @var string
41
     *
42
     * @ORM\Column(name="secret_key", type="string", length=64, nullable=false, unique=true)
43
     */
44
    protected $secretKey;
45
46
    /**
47
     * @var string
48
     *
49
     * @ORM\Column(name="mime", type="string", length=100, nullable=true)
50
     */
51
    protected $mime;
52
53
    /**
54
     * @var string
55
     *
56
     * @ORM\Column(name="lifetime", type="datetime", nullable=true)
57
     */
58
    protected $lifetime;
59
60
    /**
61
     * @var \DateTime
62
     *
63
     * @Gedmo\Timestampable(on="create")
64
     * @ORM\Column(name="date_created", type="datetime", nullable=false)
65
     */
66
    protected $dateCreated;
67
68
    /**
69
     * @var \DateTime
70
     * @Gedmo\Timestampable(on="update")
71
     * @ORM\Column(name="date_updated", type="datetime", nullable=false)
72
     */
73
    protected $dateUpdated;
74
75
    /**
76
     * @var string
77
     *
78
     * @Gedmo\IpTraceable(on="create")
79
     * @ORM\Column(length=45, nullable=true)
80
     */
81
    protected $createdFromIp;
82
83
    public function __construct()
84
    {
85
    }
86
87
    public function getFolder()
88
    {
89
        return str_replace(basename($this->uri), '', $this->uri);
90
    }
91
92
    /**
93
     * Gets the value of id.
94
     *
95
     * @return int
96
     */
97
    public function getId()
98
    {
99
        return $this->id;
100
    }
101
102
    /**
103
     * Sets the value of id.
104
     *
105
     * @param int $id the id
106
     *
107
     * @return self
108
     */
109
    public function setId($id)
110
    {
111
        $this->id = $id;
112
113
        return $this;
114
    }
115
116
    /**
117
     * Gets the value of name.
118
     *
119
     * @return string $name
120
     */
121
    public function getName()
122
    {
123
        return $this->name;
124
    }
125
126
    /**
127
     * Sets the value of name.
128
     *
129
     * @param string $name $name the name
130
     *
131
     * @return self
132
     */
133
    public function setName($name)
134
    {
135
        $this->name = $name;
136
137
        return $this;
138
    }
139
140
    /**
141
     * Gets the value of uri.
142
     *
143
     * @return string $name
144
     */
145
    public function getUri()
146
    {
147
        return $this->uri;
148
    }
149
150
    /**
151
     * Sets the value of uri.
152
     *
153
     * @param string $name $uri the uri
0 ignored issues
show
Bug introduced by
There is no parameter named $name. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
154
     *
155
     * @return self
156
     */
157
    public function setUri($uri)
158
    {
159
        $this->uri = $uri;
160
161
        return $this;
162
    }
163
164
    /**
165
     * Gets the value of secretKey.
166
     *
167
     * @return string $name
168
     */
169
    public function getSecretKey()
170
    {
171
        return $this->secretKey;
172
    }
173
174
    /**
175
     * Sets the value of secretKey.
176
     *
177
     * @param string $name $secretKey the secret key
0 ignored issues
show
Bug introduced by
There is no parameter named $name. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
178
     *
179
     * @return self
180
     */
181
    public function setSecretKey($secretKey)
182
    {
183
        $this->secretKey = $secretKey;
184
185
        return $this;
186
    }
187
188
    /**
189
     * Gets the value of mime.
190
     *
191
     * @return string $name
192
     */
193
    public function getMime()
194
    {
195
        return $this->mime;
196
    }
197
198
    /**
199
     * Sets the value of mime.
200
     *
201
     * @param string $name $mime the mime
0 ignored issues
show
Bug introduced by
There is no parameter named $name. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
202
     *
203
     * @return self
204
     */
205
    public function setMime($mime)
206
    {
207
        $this->mime = $mime;
208
209
        return $this;
210
    }
211
212
    /**
213
     * Gets the value of lifetime.
214
     *
215
     * @return string $label
216
     */
217
    public function getLifetime()
218
    {
219
        return $this->lifetime;
220
    }
221
222
    /**
223
     * Sets the value of lifetime.
224
     *
225
     * @param string $label $lifetime the lifetime
0 ignored issues
show
Bug introduced by
There is no parameter named $label. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
226
     *
227
     * @return self
228
     */
229
    public function setLifetime($lifetime)
230
    {
231
        $this->lifetime = $lifetime;
232
233
        return $this;
234
    }
235
236
    /**
237
     * Gets the value of dateCreated.
238
     *
239
     * @return \DateTime
240
     */
241
    public function getDateCreated()
242
    {
243
        return $this->dateCreated;
244
    }
245
246
    /**
247
     * Sets the value of dateCreated.
248
     *
249
     * @param \DateTime $dateCreated the date created
250
     *
251
     * @return self
252
     */
253
    public function setDateCreated(\DateTime $dateCreated)
254
    {
255
        $this->dateCreated = $dateCreated;
256
257
        return $this;
258
    }
259
260
    /**
261
     * Gets the value of dateUpdated.
262
     *
263
     * @return \DateTime
264
     */
265
    public function getDateUpdated()
266
    {
267
        return $this->dateUpdated;
268
    }
269
270
    /**
271
     * Sets the value of dateUpdated.
272
     *
273
     * @param \DateTime $dateUpdated the date updated
274
     *
275
     * @return self
276
     */
277
    public function setDateUpdated(\DateTime $dateUpdated)
278
    {
279
        $this->dateUpdated = $dateUpdated;
280
281
        return $this;
282
    }
283
284
    /**
285
     * Gets the value of createdFromIp.
286
     *
287
     * @return string $createdFromIp
288
     */
289
    public function getCreatedFromIp()
290
    {
291
        return $this->createdFromIp;
292
    }
293
294
    /**
295
     * Sets the value of createdFromIp.
296
     *
297
     * @param string $createdFromIp $createdFromIp the created from ip
298
     *
299
     * @return self
300
     */
301
    public function setCreatedFromIp($createdFromIp)
302
    {
303
        $this->createdFromIp = $createdFromIp;
304
305
        return $this;
306
    }
307
}
308