1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the pexels-library package. |
5
|
|
|
* |
6
|
|
|
* (c) 2019 WEBEWEB |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace WBW\Library\Pexels\Model; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* Video. |
16
|
|
|
* |
17
|
|
|
* @author webeweb <https://github.com/webeweb/> |
18
|
|
|
* @package WBW\Library\Pexels\Model |
19
|
|
|
*/ |
20
|
|
|
class Video extends AbstractMedia { |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Duration. |
24
|
|
|
* |
25
|
|
|
* @var int |
26
|
|
|
*/ |
27
|
|
|
private $duration; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* Full res. |
31
|
|
|
* |
32
|
|
|
* @var mixed |
33
|
|
|
*/ |
34
|
|
|
private $fullRes; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* Image. |
38
|
|
|
* |
39
|
|
|
* @var string |
40
|
|
|
*/ |
41
|
|
|
private $image; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Video files. |
45
|
|
|
* |
46
|
|
|
* @var VideoFile[] |
47
|
|
|
*/ |
48
|
|
|
private $videoFiles; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* Video pictures. |
52
|
|
|
* |
53
|
|
|
* @var VideoPicture[] |
54
|
|
|
*/ |
55
|
|
|
private $videoPictures; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* Constructor. |
59
|
|
|
*/ |
60
|
|
|
public function __construct() { |
61
|
|
|
$this->setVideoFiles([]); |
62
|
|
|
$this->setVideoPictures([]); |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* Add a video file. |
67
|
|
|
* |
68
|
|
|
* @param VideoFile $videoFile The video file. |
69
|
|
|
* @return Video Returns this video. |
70
|
|
|
*/ |
71
|
|
|
public function addVideoFile(VideoFile $videoFile) { |
72
|
|
|
$this->videoFiles[] = $videoFile; |
73
|
|
|
return $this; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* Add a video picture. |
78
|
|
|
* |
79
|
|
|
* @param VideoPicture $videoPicture The video picture. |
80
|
|
|
* @return Video Returns this video. |
81
|
|
|
*/ |
82
|
|
|
public function addVideoPicture(VideoPicture $videoPicture) { |
83
|
|
|
$this->videoPictures[] = $videoPicture; |
84
|
|
|
return $this; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* Get the duration. |
89
|
|
|
* |
90
|
|
|
* @return int Returns the duration. |
91
|
|
|
*/ |
92
|
|
|
public function getDuration() { |
93
|
|
|
return $this->duration; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* Get the full res. |
98
|
|
|
* |
99
|
|
|
* @return mixed Returns the full res. |
100
|
|
|
*/ |
101
|
|
|
public function getFullRes() { |
102
|
|
|
return $this->fullRes; |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* Get the image. |
107
|
|
|
* |
108
|
|
|
* @return string Returns the image. |
109
|
|
|
*/ |
110
|
|
|
public function getImage() { |
111
|
|
|
return $this->image; |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* Get the video files. |
116
|
|
|
* |
117
|
|
|
* @return VideoFile[] Returns teh video files. |
118
|
|
|
*/ |
119
|
|
|
public function getVideoFiles() { |
120
|
|
|
return $this->videoFiles; |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* Get the video pictures. |
125
|
|
|
* |
126
|
|
|
* @return VideoPicture[] Returns teh video pictures. |
127
|
|
|
*/ |
128
|
|
|
public function getVideoPictures() { |
129
|
|
|
return $this->videoPictures; |
130
|
|
|
} |
131
|
|
|
|
132
|
|
|
/** |
133
|
|
|
* Set the duration. |
134
|
|
|
* |
135
|
|
|
* @param int $duration The duration. |
136
|
|
|
* @return Video Returns this video. |
137
|
|
|
*/ |
138
|
|
|
public function setDuration($duration) { |
139
|
|
|
$this->duration = $duration; |
140
|
|
|
return $this; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* Set the full re. |
145
|
|
|
* |
146
|
|
|
* @param mixed $fullRes The full res. |
147
|
|
|
* @return Video Returns this video. |
148
|
|
|
*/ |
149
|
|
|
public function setFullRes($fullRes) { |
150
|
|
|
$this->fullRes = $fullRes; |
151
|
|
|
return $this; |
152
|
|
|
} |
153
|
|
|
|
154
|
|
|
/** |
155
|
|
|
* Set the image. |
156
|
|
|
* |
157
|
|
|
* @param string $image The image. |
158
|
|
|
* @return Video Returns this video. |
159
|
|
|
*/ |
160
|
|
|
public function setImage($image) { |
161
|
|
|
$this->image = $image; |
162
|
|
|
return $this; |
163
|
|
|
} |
164
|
|
|
|
165
|
|
|
/** |
166
|
|
|
* Set the video files. |
167
|
|
|
* |
168
|
|
|
* @param VideoFile[] $videoFiles The video files. |
169
|
|
|
* @return Video Returns this video. |
170
|
|
|
*/ |
171
|
|
|
protected function setVideoFiles(array $videoFiles) { |
172
|
|
|
$this->videoFiles = $videoFiles; |
173
|
|
|
return $this; |
174
|
|
|
} |
175
|
|
|
|
176
|
|
|
/** |
177
|
|
|
* Set the video pictures. |
178
|
|
|
* |
179
|
|
|
* @param VideoPicture[] $videoPictures The video pictures. |
180
|
|
|
* @return Video Returns this video. |
181
|
|
|
*/ |
182
|
|
|
protected function setVideoPictures(array $videoPictures) { |
183
|
|
|
$this->videoPictures = $videoPictures; |
184
|
|
|
return $this; |
185
|
|
|
} |
186
|
|
|
} |
187
|
|
|
|