Video::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace AppBundle\Entity;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
7
/**
8
 * Video.
9
 */
10
class Video
11
{
12
    /**
13
     * @var int
14
     */
15
    private $id;
16
17
    /**
18
     * @var string
19
     */
20
    private $title;
21
22
    /**
23
     * @var string
24
     */
25
    private $description;
26
27
    private $videoFile;
28
29
    private $videoName;
30
31
    private $updatedAt;
32
33
    private $tags;
34
35
    private $creator;
36
37
    const STATUS_VIDEO_DRAFT = 0; //no video file yet
38
39
    const STATUS_VIDEO_UPLOADED = 1; //video has been uploaded
40
41
    const STATUS_VIDEO_ENCODING = 2; //video is being encoded by encoder
42
43
    const STATUS_VIDEO_ENCODED = 3; //video is encoded and ready to be served
44
45
    /**
46
     * @return ArrayCollection
47
     */
48
    public function getTags()
49
    {
50
        return $this->tags;
51
    }
52
53
    /**
54
     * @param ArrayCollection $tags
55
     */
56
    public function setTags($tags)
57
    {
58
        $this->tags = $tags;
59
    }
60
61
    public function addTag($tag)
62
    {
63
        $this->tags->add($tag);
64
    }
65
66
    /**
67
     * Get id.
68
     *
69
     * @return int
70
     */
71
    public function getId()
72
    {
73
        return $this->id;
74
    }
75
76
    /**
77
     * Set name.
78
     *
79
     * @param string $name
80
     *
81
     * @return Video
82
     */
83
    public function setName($name)
84
    {
85
        $this->title = $name;
86
87
        return $this;
88
    }
89
90
    /**
91
     * Get name.
92
     *
93
     * @return string
94
     */
95
    public function getName()
96
    {
97
        return $this->title;
98
    }
99
100
    /**
101
     * Set description.
102
     *
103
     * @param string $description
104
     *
105
     * @return Video
106
     */
107
    public function setDescription($description)
108
    {
109
        $this->description = $description;
110
111
        return $this;
112
    }
113
114
    /**
115
     * Get description.
116
     *
117
     * @return string
118
     */
119
    public function getDescription()
120
    {
121
        return $this->description;
122
    }
123
124
    /**
125
     * @return mixed
126
     */
127
    public function getVideoFile()
128
    {
129
        return $this->videoFile;
130
    }
131
132
    /**
133
     * @param mixed $videoFile
134
     */
135
    public function setVideoFile($videoFile)
136
    {
137
        $this->videoFile = $videoFile;
138
    }
139
140
    /**
141
     * @return mixed
142
     */
143
    public function getVideoName()
144
    {
145
        return $this->videoName;
146
    }
147
148
    /**
149
     * @param mixed $videoName
150
     */
151
    public function setVideoName($videoName)
152
    {
153
        $this->videoName = $videoName;
154
    }
155
156
    /**
157
     * @return mixed
158
     */
159
    public function getUpdatedAt()
160
    {
161
        return $this->updatedAt;
162
    }
163
164
    /**
165
     * @param mixed $updatedAt
166
     */
167
    public function setUpdatedAt($updatedAt)
168
    {
169
        $this->updatedAt = $updatedAt;
170
    }
171
172
    /**
173
     * @return string
174
     */
175
    public function getTitle()
176
    {
177
        return $this->title;
178
    }
179
180
    /**
181
     * @param string $title
182
     */
183
    public function setTitle($title)
184
    {
185
        $this->title = $title;
186
    }
187
188
    public function __construct()
189
    {
190
        $this->tags = new ArrayCollection();
191
        $this->setUpdatedAt(new \DateTime());
192
    }
193
194
    /**
195
     * @return mixed
196
     */
197
    public function getCreator()
198
    {
199
        return $this->creator;
200
    }
201
202
    /**
203
     * @param mixed $creator
204
     */
205
    public function setCreator($creator)
206
    {
207
        $this->creator = $creator;
208
    }
209
}
210