1 | <?php |
||
60 | class Video extends Extension |
||
61 | { |
||
62 | use DateTime; |
||
63 | use IsAssoc; |
||
64 | |||
65 | /** |
||
66 | * Name of Namescapce |
||
67 | */ |
||
68 | const NAMESPACE_NAME = 'video'; |
||
69 | |||
70 | /** |
||
71 | * Namespace URL |
||
72 | */ |
||
73 | const NAMESPACE_URL = 'http://www.google.com/schemas/sitemap-video/1.1'; |
||
74 | |||
75 | /** |
||
76 | * Element name |
||
77 | */ |
||
78 | const ELEMENT_NAME = 'video'; |
||
79 | |||
80 | /** |
||
81 | * URL pointing to an image thumbnail. |
||
82 | * |
||
83 | * @var \Wszetko\Sitemap\Items\DataTypes\URLType |
||
84 | */ |
||
85 | protected $thumbnailLoc; |
||
86 | |||
87 | /** |
||
88 | * Title of the video, max 100 characters. |
||
89 | * |
||
90 | * @var \Wszetko\Sitemap\Items\DataTypes\StringType |
||
91 | */ |
||
92 | protected $title; |
||
93 | |||
94 | /** |
||
95 | * Description of the video, max 2048 characters. |
||
96 | * |
||
97 | * @var \Wszetko\Sitemap\Items\DataTypes\StringType |
||
98 | */ |
||
99 | protected $description; |
||
100 | |||
101 | /** |
||
102 | * URL pointing to the actual media file (mp4). |
||
103 | * |
||
104 | * @var \Wszetko\Sitemap\Items\DataTypes\URLType |
||
105 | */ |
||
106 | protected $contentLoc; |
||
107 | |||
108 | /** |
||
109 | * URL pointing to the player file (normally a SWF). |
||
110 | * |
||
111 | * @attribute allow_embed |
||
112 | * @attributeDataType \Wszetko\Sitemap\Items\DataTypes\YesNoType |
||
113 | * @attribute autoplay |
||
114 | * @attributeDataType \Wszetko\Sitemap\Items\DataTypes\StringType |
||
115 | * @var \Wszetko\Sitemap\Items\DataTypes\URLType |
||
116 | */ |
||
117 | protected $playerLoc; |
||
118 | |||
119 | /** |
||
120 | * Indicates whether the video is live. |
||
121 | * |
||
122 | * @var \Wszetko\Sitemap\Items\DataTypes\YesNoType |
||
123 | */ |
||
124 | protected $live; |
||
125 | |||
126 | /** |
||
127 | * Duration of the video in seconds. |
||
128 | * |
||
129 | * @var \Wszetko\Sitemap\Items\DataTypes\IntegerType |
||
130 | */ |
||
131 | protected $duration; |
||
132 | |||
133 | /** |
||
134 | * String of space delimited platform values. |
||
135 | * Allowed values are web, mobile, and tv. |
||
136 | * |
||
137 | * @attribute relationship |
||
138 | * @attributeDataType \Wszetko\Sitemap\Items\DataTypes\StringType |
||
139 | * @var \Wszetko\Sitemap\Items\DataTypes\StringType |
||
140 | */ |
||
141 | protected $platform; |
||
142 | |||
143 | /** |
||
144 | * Does the video require a subscription? |
||
145 | * |
||
146 | * @var \Wszetko\Sitemap\Items\DataTypes\YesNoType |
||
147 | */ |
||
148 | protected $requiresSubscription; |
||
149 | |||
150 | /** |
||
151 | * @attribute currency |
||
152 | * @attributeDataType \Wszetko\Sitemap\Items\DataTypes\StringType |
||
153 | * @attribute type |
||
154 | * @attributeDataType \Wszetko\Sitemap\Items\DataTypes\StringType |
||
155 | * @attribute resolution |
||
156 | * @attributeDataType \Wszetko\Sitemap\Items\DataTypes\StringType |
||
157 | * @var \Wszetko\Sitemap\Items\DataTypes\FloatType |
||
158 | */ |
||
159 | protected $price; |
||
160 | |||
161 | /** |
||
162 | * Link to gallery of which this video appears in. |
||
163 | * |
||
164 | * @var \Wszetko\Sitemap\Items\DataTypes\URLType |
||
165 | */ |
||
166 | protected $galleryLoc; |
||
167 | |||
168 | /** |
||
169 | * A space-delimited list of countries where the video may or may not be played. |
||
170 | * |
||
171 | * @attribute relationship |
||
172 | * @attributeDataType \Wszetko\Sitemap\Items\DataTypes\StringType |
||
173 | * @var \Wszetko\Sitemap\Items\DataTypes\StringType |
||
174 | */ |
||
175 | protected $restriction; |
||
176 | |||
177 | /** |
||
178 | * A tag associated with the video. |
||
179 | * |
||
180 | * @dataType \Wszetko\Sitemap\Items\DataTypes\StringType |
||
181 | * @var \Wszetko\Sitemap\Items\DataTypes\ArrayType |
||
182 | */ |
||
183 | protected $tag; |
||
184 | |||
185 | /** |
||
186 | * The video's category. For example, cooking. |
||
187 | * |
||
188 | * @var \Wszetko\Sitemap\Items\DataTypes\StringType |
||
189 | */ |
||
190 | protected $category; |
||
191 | |||
192 | /** |
||
193 | * No if the video should be available only to users with SafeSearch turned off. |
||
194 | * |
||
195 | * @var \Wszetko\Sitemap\Items\DataTypes\YesNoType |
||
196 | */ |
||
197 | protected $familyFriendly; |
||
198 | |||
199 | /** |
||
200 | * The date the video was first published. |
||
201 | * |
||
202 | * @var \Wszetko\Sitemap\Items\DataTypes\DateTimeType |
||
203 | */ |
||
204 | protected $publicationDate; |
||
205 | |||
206 | /** |
||
207 | * The number of times the video has been viewed. |
||
208 | * |
||
209 | * @var \Wszetko\Sitemap\Items\DataTypes\IntegerType |
||
210 | */ |
||
211 | protected $viewCount; |
||
212 | |||
213 | /** |
||
214 | * The video uploader's name. Only one <video:uploader> is allowed per video. |
||
215 | * |
||
216 | * @attribute info |
||
217 | * @attributeDataType \Wszetko\Sitemap\Items\DataTypes\URLType |
||
218 | * @var \Wszetko\Sitemap\Items\DataTypes\StringType |
||
219 | */ |
||
220 | protected $uploader; |
||
221 | |||
222 | /** |
||
223 | * The rating of the video. Allowed values are float numbers in the range 0.0 to 5.0. |
||
224 | * |
||
225 | * @var \Wszetko\Sitemap\Items\DataTypes\FloatType |
||
226 | */ |
||
227 | protected $rating; |
||
228 | |||
229 | /** |
||
230 | * The date after which the video will no longer be available |
||
231 | * |
||
232 | * @var \Wszetko\Sitemap\Items\DataTypes\DateTimeType |
||
233 | */ |
||
234 | protected $expirationDate; |
||
235 | |||
236 | /** |
||
237 | * Video constructor. |
||
238 | * |
||
239 | * @param string $thumbnailLoc |
||
240 | * @param string $title |
||
241 | * @param string $description |
||
242 | * |
||
243 | * @throws InvalidArgumentException |
||
244 | * @throws \ReflectionException |
||
245 | */ |
||
246 | 24 | public function __construct($thumbnailLoc, $title, $description) |
|
297 | |||
298 | /** |
||
299 | * @return array |
||
300 | */ |
||
301 | 1 | public function toArray(): array |
|
309 | } |
||
310 |