Completed
Push — master ( f93802...a3beff )
by Paweł
34:14
created

Image   A

Complexity

Total Complexity 15

Size/Duplication

Total Lines 173
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 15
lcom 0
cbo 1
dl 0
loc 173
ccs 0
cts 38
cp 0
rs 10
c 0
b 0
f 0

15 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getMedia() 0 4 1
A setMedia() 0 4 1
A setId() 0 4 1
A getId() 0 4 1
A setFileExtension() 0 4 1
A getFileExtension() 0 4 1
A getAssetId() 0 4 1
A setAssetId() 0 4 1
A getRendition() 0 4 1
A setRendition() 0 4 1
A getWidth() 0 4 1
A setWidth() 0 6 1
A getHeight() 0 4 1
A setHeight() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of the Superdesk Web Publisher Content Bundle.
5
 *
6
 * Copyright 2016 Sourcefabric z.ú. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2016 Sourcefabric z.ú
12
 * @license http://www.superdesk.org/license
13
 */
14
15
namespace SWP\Bundle\ContentBundle\Model;
16
17
use SWP\Component\Common\Model\TimestampableTrait;
18
19
class Image implements ImageInterface
20
{
21
    use TimestampableTrait;
22
23
    /**
24
     * @var string
25
     */
26
    protected $id;
27
28
    /**
29
     * Uploaded file extension.
30
     *
31
     * @var string
32
     */
33
    protected $fileExtension;
34
35
    /**
36
     * @var string
37
     */
38
    protected $assetId;
39
40
    /**
41
     * @var ArticleMediaInterface
42
     */
43
    protected $media;
44
45
    /**
46
     * @var int
47
     */
48
    protected $width;
49
50
    /**
51
     * @var int
52
     */
53
    protected $height;
54
55
    /**
56
     * @var ImageRenditionInterface
57
     */
58
    protected $rendition;
59
60
    /**
61
     * File constructor.
62
     */
63
    public function __construct()
64
    {
65
        $this->setCreatedAt(new \DateTime());
66
    }
67
68
    /**
69
     * @return ArticleMediaInterface
70
     */
71
    public function getMedia(): ArticleMediaInterface
72
    {
73
        return $this->media;
74
    }
75
76
    /**
77
     * @param ArticleMediaInterface $media
78
     */
79
    public function setMedia(ArticleMediaInterface $media)
80
    {
81
        $this->media = $media;
82
    }
83
84
    /**
85
     * @param string $id
86
     */
87
    public function setId($id)
88
    {
89
        $this->id = $id;
90
    }
91
92
    /**
93
     * {@inheritdoc}
94
     */
95
    public function getId()
96
    {
97
        return $this->id;
98
    }
99
100
    /**
101
     * {@inheritdoc}
102
     */
103
    public function setFileExtension($extension)
104
    {
105
        $this->fileExtension = $extension;
106
    }
107
108
    /**
109
     * {@inheritdoc}
110
     */
111
    public function getFileExtension()
112
    {
113
        return $this->fileExtension;
114
    }
115
116
    /**
117
     * @return string
118
     */
119
    public function getAssetId(): string
120
    {
121
        return $this->assetId;
122
    }
123
124
    /**
125
     * {@inheritdoc}
126
     */
127
    public function setAssetId(string $assetId)
128
    {
129
        $this->assetId = $assetId;
130
    }
131
132
    /**
133
     * @return ImageRenditionInterface
134
     */
135
    public function getRendition()
136
    {
137
        return $this->rendition;
138
    }
139
140
    /**
141
     * @param ImageRenditionInterface $rendition
142
     */
143
    public function setRendition(ImageRenditionInterface $rendition)
144
    {
145
        $this->rendition = $rendition;
146
    }
147
148
    /**
149
     * {@inheritdoc}
150
     */
151
    public function getWidth()
152
    {
153
        return $this->width;
154
    }
155
156
    /**
157
     * Set the value of Width.
158
     *
159
     * @param int $width
160
     *
161
     * @return self
162
     */
163
    public function setWidth($width)
164
    {
165
        $this->width = $width;
166
167
        return $this;
168
    }
169
170
    /**
171
     * {@inheritdoc}
172
     */
173
    public function getHeight()
174
    {
175
        return $this->height;
176
    }
177
178
    /**
179
     * Set the value of Height.
180
     *
181
     * @param int $height
182
     *
183
     * @return self
184
     */
185
    public function setHeight($height)
186
    {
187
        $this->height = $height;
188
189
        return $this;
190
    }
191
}
192