1 | <?php
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * Zend Framework
|
---|
5 | *
|
---|
6 | * LICENSE
|
---|
7 | *
|
---|
8 | * This source file is subject to the new BSD license that is bundled
|
---|
9 | * with this package in the file LICENSE.txt.
|
---|
10 | * It is also available through the world-wide-web at this URL:
|
---|
11 | * http://framework.zend.com/license/new-bsd
|
---|
12 | * If you did not receive a copy of the license and are unable to
|
---|
13 | * obtain it through the world-wide-web, please send an email
|
---|
14 | * to license@zend.com so we can send you a copy immediately.
|
---|
15 | *
|
---|
16 | * @category Zend
|
---|
17 | * @package Zend_Gdata
|
---|
18 | * @subpackage YouTube
|
---|
19 | * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
---|
20 | * @license http://framework.zend.com/license/new-bsd New BSD License
|
---|
21 | */
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * @see Zend_Gdata_Entry
|
---|
25 | */
|
---|
26 | require_once 'Zend/Gdata/Entry.php';
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * @see Zend_Gdata_Extension_FeedLink
|
---|
30 | */
|
---|
31 | require_once 'Zend/Gdata/Extension/FeedLink.php';
|
---|
32 |
|
---|
33 | /**
|
---|
34 | * @see Zend_Gdata_YouTube_Extension_Description
|
---|
35 | */
|
---|
36 | require_once 'Zend/Gdata/YouTube/Extension/Description.php';
|
---|
37 |
|
---|
38 | /**
|
---|
39 | * @see Zend_Gdata_YouTube_Extension_AboutMe
|
---|
40 | */
|
---|
41 | require_once 'Zend/Gdata/YouTube/Extension/AboutMe.php';
|
---|
42 |
|
---|
43 | /**
|
---|
44 | * @see Zend_Gdata_YouTube_Extension_Age
|
---|
45 | */
|
---|
46 | require_once 'Zend/Gdata/YouTube/Extension/Age.php';
|
---|
47 |
|
---|
48 | /**
|
---|
49 | * @see Zend_Gdata_YouTube_Extension_Username
|
---|
50 | */
|
---|
51 | require_once 'Zend/Gdata/YouTube/Extension/Username.php';
|
---|
52 |
|
---|
53 | /**
|
---|
54 | * @see Zend_Gdata_YouTube_Extension_Books
|
---|
55 | */
|
---|
56 | require_once 'Zend/Gdata/YouTube/Extension/Books.php';
|
---|
57 |
|
---|
58 | /**
|
---|
59 | * @see Zend_Gdata_YouTube_Extension_Company
|
---|
60 | */
|
---|
61 | require_once 'Zend/Gdata/YouTube/Extension/Company.php';
|
---|
62 |
|
---|
63 | /**
|
---|
64 | * @see Zend_Gdata_YouTube_Extension_Hobbies
|
---|
65 | */
|
---|
66 | require_once 'Zend/Gdata/YouTube/Extension/Hobbies.php';
|
---|
67 |
|
---|
68 | /**
|
---|
69 | * @see Zend_Gdata_YouTube_Extension_Hometown
|
---|
70 | */
|
---|
71 | require_once 'Zend/Gdata/YouTube/Extension/Hometown.php';
|
---|
72 |
|
---|
73 | /**
|
---|
74 | * @see Zend_Gdata_YouTube_Extension_Location
|
---|
75 | */
|
---|
76 | require_once 'Zend/Gdata/YouTube/Extension/Location.php';
|
---|
77 |
|
---|
78 | /**
|
---|
79 | * @see Zend_Gdata_YouTube_Extension_Movies
|
---|
80 | */
|
---|
81 | require_once 'Zend/Gdata/YouTube/Extension/Movies.php';
|
---|
82 |
|
---|
83 | /**
|
---|
84 | * @see Zend_Gdata_YouTube_Extension_Music
|
---|
85 | */
|
---|
86 | require_once 'Zend/Gdata/YouTube/Extension/Music.php';
|
---|
87 |
|
---|
88 | /**
|
---|
89 | * @see Zend_Gdata_YouTube_Extension_Occupation
|
---|
90 | */
|
---|
91 | require_once 'Zend/Gdata/YouTube/Extension/Occupation.php';
|
---|
92 |
|
---|
93 | /**
|
---|
94 | * @see Zend_Gdata_YouTube_Extension_School
|
---|
95 | */
|
---|
96 | require_once 'Zend/Gdata/YouTube/Extension/School.php';
|
---|
97 |
|
---|
98 | /**
|
---|
99 | * @see Zend_Gdata_YouTube_Extension_Gender
|
---|
100 | */
|
---|
101 | require_once 'Zend/Gdata/YouTube/Extension/Gender.php';
|
---|
102 |
|
---|
103 | /**
|
---|
104 | * @see Zend_Gdata_YouTube_Extension_Relationship
|
---|
105 | */
|
---|
106 | require_once 'Zend/Gdata/YouTube/Extension/Relationship.php';
|
---|
107 |
|
---|
108 | /**
|
---|
109 | * @see Zend_Gdata_YouTube_Extension_FirstName
|
---|
110 | */
|
---|
111 | require_once 'Zend/Gdata/YouTube/Extension/FirstName.php';
|
---|
112 |
|
---|
113 | /**
|
---|
114 | * @see Zend_Gdata_YouTube_Extension_LastName
|
---|
115 | */
|
---|
116 | require_once 'Zend/Gdata/YouTube/Extension/LastName.php';
|
---|
117 |
|
---|
118 | /**
|
---|
119 | * @see Zend_Gdata_YouTube_Extension_Statistics
|
---|
120 | */
|
---|
121 | require_once 'Zend/Gdata/YouTube/Extension/Statistics.php';
|
---|
122 |
|
---|
123 | /**
|
---|
124 | * @see Zend_Gdata_Media_Extension_MediaThumbnail
|
---|
125 | */
|
---|
126 | require_once 'Zend/Gdata/Media/Extension/MediaThumbnail.php';
|
---|
127 |
|
---|
128 | /**
|
---|
129 | * Represents the YouTube video playlist flavor of an Atom entry
|
---|
130 | *
|
---|
131 | * @category Zend
|
---|
132 | * @package Zend_Gdata
|
---|
133 | * @subpackage YouTube
|
---|
134 | * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
---|
135 | * @license http://framework.zend.com/license/new-bsd New BSD License
|
---|
136 | */
|
---|
137 | class Zend_Gdata_YouTube_UserProfileEntry extends Zend_Gdata_Entry
|
---|
138 | {
|
---|
139 |
|
---|
140 | protected $_entryClassName = 'Zend_Gdata_YouTube_UserProfileEntry';
|
---|
141 |
|
---|
142 | /**
|
---|
143 | * Nested feed links
|
---|
144 | *
|
---|
145 | * @var array
|
---|
146 | */
|
---|
147 | protected $_feedLink = array();
|
---|
148 |
|
---|
149 | /**
|
---|
150 | * The username for this profile entry
|
---|
151 | *
|
---|
152 | * @var string
|
---|
153 | */
|
---|
154 | protected $_username = null;
|
---|
155 |
|
---|
156 | /**
|
---|
157 | * The description of the user
|
---|
158 | *
|
---|
159 | * @var string
|
---|
160 | */
|
---|
161 | protected $_description = null;
|
---|
162 |
|
---|
163 | /**
|
---|
164 | * The contents of the 'About Me' field.
|
---|
165 | *
|
---|
166 | * @var string
|
---|
167 | */
|
---|
168 | protected $_aboutMe = null;
|
---|
169 |
|
---|
170 | /**
|
---|
171 | * The age of the user
|
---|
172 | *
|
---|
173 | * @var int
|
---|
174 | */
|
---|
175 | protected $_age = null;
|
---|
176 |
|
---|
177 | /**
|
---|
178 | * Books of interest to the user
|
---|
179 | *
|
---|
180 | * @var string
|
---|
181 | */
|
---|
182 | protected $_books = null;
|
---|
183 |
|
---|
184 | /**
|
---|
185 | * Company
|
---|
186 | *
|
---|
187 | * @var string
|
---|
188 | */
|
---|
189 | protected $_company = null;
|
---|
190 |
|
---|
191 | /**
|
---|
192 | * Hobbies
|
---|
193 | *
|
---|
194 | * @var string
|
---|
195 | */
|
---|
196 | protected $_hobbies = null;
|
---|
197 |
|
---|
198 | /**
|
---|
199 | * Hometown
|
---|
200 | *
|
---|
201 | * @var string
|
---|
202 | */
|
---|
203 | protected $_hometown = null;
|
---|
204 |
|
---|
205 | /**
|
---|
206 | * Location
|
---|
207 | *
|
---|
208 | * @var string
|
---|
209 | */
|
---|
210 | protected $_location = null;
|
---|
211 |
|
---|
212 | /**
|
---|
213 | * Movies
|
---|
214 | *
|
---|
215 | * @var string
|
---|
216 | */
|
---|
217 | protected $_movies = null;
|
---|
218 |
|
---|
219 | /**
|
---|
220 | * Music
|
---|
221 | *
|
---|
222 | * @var string
|
---|
223 | */
|
---|
224 | protected $_music = null;
|
---|
225 |
|
---|
226 | /**
|
---|
227 | * Occupation
|
---|
228 | *
|
---|
229 | * @var string
|
---|
230 | */
|
---|
231 | protected $_occupation = null;
|
---|
232 |
|
---|
233 | /**
|
---|
234 | * School
|
---|
235 | *
|
---|
236 | * @var string
|
---|
237 | */
|
---|
238 | protected $_school = null;
|
---|
239 |
|
---|
240 | /**
|
---|
241 | * Gender
|
---|
242 | *
|
---|
243 | * @var string
|
---|
244 | */
|
---|
245 | protected $_gender = null;
|
---|
246 |
|
---|
247 | /**
|
---|
248 | * Relationship
|
---|
249 | *
|
---|
250 | * @var string
|
---|
251 | */
|
---|
252 | protected $_relationship = null;
|
---|
253 |
|
---|
254 | /**
|
---|
255 | * First name
|
---|
256 | *
|
---|
257 | * @var string
|
---|
258 | */
|
---|
259 | protected $_firstName = null;
|
---|
260 |
|
---|
261 | /**
|
---|
262 | * Last name
|
---|
263 | *
|
---|
264 | * @var string
|
---|
265 | */
|
---|
266 | protected $_lastName = null;
|
---|
267 |
|
---|
268 | /**
|
---|
269 | * Statistics
|
---|
270 | *
|
---|
271 | * @var Zend_Gdata_YouTube_Extension_Statistics
|
---|
272 | */
|
---|
273 | protected $_statistics = null;
|
---|
274 |
|
---|
275 | /**
|
---|
276 | * Thumbnail
|
---|
277 | *
|
---|
278 | * @var Zend_Gdata_Media_Extension_MediaThumbnail
|
---|
279 | */
|
---|
280 | protected $_thumbnail = null;
|
---|
281 |
|
---|
282 | /**
|
---|
283 | * Creates a User Profile entry, representing an individual user
|
---|
284 | * and their attributes.
|
---|
285 | *
|
---|
286 | * @param DOMElement $element (optional) DOMElement from which this
|
---|
287 | * object should be constructed.
|
---|
288 | */
|
---|
289 | public function __construct($element = null)
|
---|
290 | {
|
---|
291 | $this->registerAllNamespaces(Zend_Gdata_YouTube::$namespaces);
|
---|
292 | parent::__construct($element);
|
---|
293 | }
|
---|
294 |
|
---|
295 | /**
|
---|
296 | * Retrieves a DOMElement which corresponds to this element and all
|
---|
297 | * child properties. This is used to build an entry back into a DOM
|
---|
298 | * and eventually XML text for sending to the server upon updates, or
|
---|
299 | * for application storage/persistence.
|
---|
300 | *
|
---|
301 | * @param DOMDocument $doc The DOMDocument used to construct DOMElements
|
---|
302 | * @return DOMElement The DOMElement representing this element and all
|
---|
303 | * child properties.
|
---|
304 | */
|
---|
305 | public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
---|
306 | {
|
---|
307 | $element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
---|
308 | if ($this->_description != null) {
|
---|
309 | $element->appendChild($this->_description->getDOM($element->ownerDocument));
|
---|
310 | }
|
---|
311 | if ($this->_aboutMe != null) {
|
---|
312 | $element->appendChild($this->_aboutMe->getDOM($element->ownerDocument));
|
---|
313 | }
|
---|
314 | if ($this->_age != null) {
|
---|
315 | $element->appendChild($this->_age->getDOM($element->ownerDocument));
|
---|
316 | }
|
---|
317 | if ($this->_username != null) {
|
---|
318 | $element->appendChild($this->_username->getDOM($element->ownerDocument));
|
---|
319 | }
|
---|
320 | if ($this->_books != null) {
|
---|
321 | $element->appendChild($this->_books->getDOM($element->ownerDocument));
|
---|
322 | }
|
---|
323 | if ($this->_company != null) {
|
---|
324 | $element->appendChild($this->_company->getDOM($element->ownerDocument));
|
---|
325 | }
|
---|
326 | if ($this->_hobbies != null) {
|
---|
327 | $element->appendChild($this->_hobbies->getDOM($element->ownerDocument));
|
---|
328 | }
|
---|
329 | if ($this->_hometown != null) {
|
---|
330 | $element->appendChild($this->_hometown->getDOM($element->ownerDocument));
|
---|
331 | }
|
---|
332 | if ($this->_location != null) {
|
---|
333 | $element->appendChild($this->_location->getDOM($element->ownerDocument));
|
---|
334 | }
|
---|
335 | if ($this->_movies != null) {
|
---|
336 | $element->appendChild($this->_movies->getDOM($element->ownerDocument));
|
---|
337 | }
|
---|
338 | if ($this->_music != null) {
|
---|
339 | $element->appendChild($this->_music->getDOM($element->ownerDocument));
|
---|
340 | }
|
---|
341 | if ($this->_occupation != null) {
|
---|
342 | $element->appendChild($this->_occupation->getDOM($element->ownerDocument));
|
---|
343 | }
|
---|
344 | if ($this->_school != null) {
|
---|
345 | $element->appendChild($this->_school->getDOM($element->ownerDocument));
|
---|
346 | }
|
---|
347 | if ($this->_gender != null) {
|
---|
348 | $element->appendChild($this->_gender->getDOM($element->ownerDocument));
|
---|
349 | }
|
---|
350 | if ($this->_relationship != null) {
|
---|
351 | $element->appendChild($this->_relationship->getDOM($element->ownerDocument));
|
---|
352 | }
|
---|
353 | if ($this->_firstName != null) {
|
---|
354 | $element->appendChild($this->_firstName->getDOM($element->ownerDocument));
|
---|
355 | }
|
---|
356 | if ($this->_lastName != null) {
|
---|
357 | $element->appendChild($this->_lastName->getDOM($element->ownerDocument));
|
---|
358 | }
|
---|
359 | if ($this->_statistics != null) {
|
---|
360 | $element->appendChild($this->_statistics->getDOM($element->ownerDocument));
|
---|
361 | }
|
---|
362 | if ($this->_thumbnail != null) {
|
---|
363 | $element->appendChild($this->_thumbnail->getDOM($element->ownerDocument));
|
---|
364 | }
|
---|
365 | if ($this->_feedLink != null) {
|
---|
366 | foreach ($this->_feedLink as $feedLink) {
|
---|
367 | $element->appendChild($feedLink->getDOM($element->ownerDocument));
|
---|
368 | }
|
---|
369 | }
|
---|
370 | return $element;
|
---|
371 | }
|
---|
372 |
|
---|
373 | /**
|
---|
374 | * Creates individual Entry objects of the appropriate type and
|
---|
375 | * stores them in the $_entry array based upon DOM data.
|
---|
376 | *
|
---|
377 | * @param DOMNode $child The DOMNode to process
|
---|
378 | */
|
---|
379 | protected function takeChildFromDOM($child)
|
---|
380 | {
|
---|
381 | $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
|
---|
382 | switch ($absoluteNodeName) {
|
---|
383 | case $this->lookupNamespace('yt') . ':' . 'description':
|
---|
384 | $description = new Zend_Gdata_YouTube_Extension_Description();
|
---|
385 | $description->transferFromDOM($child);
|
---|
386 | $this->_description = $description;
|
---|
387 | break;
|
---|
388 | case $this->lookupNamespace('yt') . ':' . 'aboutMe':
|
---|
389 | $aboutMe = new Zend_Gdata_YouTube_Extension_AboutMe();
|
---|
390 | $aboutMe->transferFromDOM($child);
|
---|
391 | $this->_aboutMe = $aboutMe;
|
---|
392 | break;
|
---|
393 | case $this->lookupNamespace('yt') . ':' . 'age':
|
---|
394 | $age = new Zend_Gdata_YouTube_Extension_Age();
|
---|
395 | $age->transferFromDOM($child);
|
---|
396 | $this->_age = $age;
|
---|
397 | break;
|
---|
398 | case $this->lookupNamespace('yt') . ':' . 'username':
|
---|
399 | $username = new Zend_Gdata_YouTube_Extension_Username();
|
---|
400 | $username->transferFromDOM($child);
|
---|
401 | $this->_username = $username;
|
---|
402 | break;
|
---|
403 | case $this->lookupNamespace('yt') . ':' . 'books':
|
---|
404 | $books = new Zend_Gdata_YouTube_Extension_Books();
|
---|
405 | $books->transferFromDOM($child);
|
---|
406 | $this->_books = $books;
|
---|
407 | break;
|
---|
408 | case $this->lookupNamespace('yt') . ':' . 'company':
|
---|
409 | $company = new Zend_Gdata_YouTube_Extension_Company();
|
---|
410 | $company->transferFromDOM($child);
|
---|
411 | $this->_company = $company;
|
---|
412 | break;
|
---|
413 | case $this->lookupNamespace('yt') . ':' . 'hobbies':
|
---|
414 | $hobbies = new Zend_Gdata_YouTube_Extension_Hobbies();
|
---|
415 | $hobbies->transferFromDOM($child);
|
---|
416 | $this->_hobbies = $hobbies;
|
---|
417 | break;
|
---|
418 | case $this->lookupNamespace('yt') . ':' . 'hometown':
|
---|
419 | $hometown = new Zend_Gdata_YouTube_Extension_Hometown();
|
---|
420 | $hometown->transferFromDOM($child);
|
---|
421 | $this->_hometown = $hometown;
|
---|
422 | break;
|
---|
423 | case $this->lookupNamespace('yt') . ':' . 'location':
|
---|
424 | $location = new Zend_Gdata_YouTube_Extension_Location();
|
---|
425 | $location->transferFromDOM($child);
|
---|
426 | $this->_location = $location;
|
---|
427 | break;
|
---|
428 | case $this->lookupNamespace('yt') . ':' . 'movies':
|
---|
429 | $movies = new Zend_Gdata_YouTube_Extension_Movies();
|
---|
430 | $movies->transferFromDOM($child);
|
---|
431 | $this->_movies = $movies;
|
---|
432 | break;
|
---|
433 | case $this->lookupNamespace('yt') . ':' . 'music':
|
---|
434 | $music = new Zend_Gdata_YouTube_Extension_Music();
|
---|
435 | $music->transferFromDOM($child);
|
---|
436 | $this->_music = $music;
|
---|
437 | break;
|
---|
438 | case $this->lookupNamespace('yt') . ':' . 'occupation':
|
---|
439 | $occupation = new Zend_Gdata_YouTube_Extension_Occupation();
|
---|
440 | $occupation->transferFromDOM($child);
|
---|
441 | $this->_occupation = $occupation;
|
---|
442 | break;
|
---|
443 | case $this->lookupNamespace('yt') . ':' . 'school':
|
---|
444 | $school = new Zend_Gdata_YouTube_Extension_School();
|
---|
445 | $school->transferFromDOM($child);
|
---|
446 | $this->_school = $school;
|
---|
447 | break;
|
---|
448 | case $this->lookupNamespace('yt') . ':' . 'gender':
|
---|
449 | $gender = new Zend_Gdata_YouTube_Extension_Gender();
|
---|
450 | $gender->transferFromDOM($child);
|
---|
451 | $this->_gender = $gender;
|
---|
452 | break;
|
---|
453 | case $this->lookupNamespace('yt') . ':' . 'relationship':
|
---|
454 | $relationship = new Zend_Gdata_YouTube_Extension_Relationship();
|
---|
455 | $relationship->transferFromDOM($child);
|
---|
456 | $this->_relationship = $relationship;
|
---|
457 | break;
|
---|
458 | case $this->lookupNamespace('yt') . ':' . 'firstName':
|
---|
459 | $firstName = new Zend_Gdata_YouTube_Extension_FirstName();
|
---|
460 | $firstName->transferFromDOM($child);
|
---|
461 | $this->_firstName = $firstName;
|
---|
462 | break;
|
---|
463 | case $this->lookupNamespace('yt') . ':' . 'lastName':
|
---|
464 | $lastName = new Zend_Gdata_YouTube_Extension_LastName();
|
---|
465 | $lastName->transferFromDOM($child);
|
---|
466 | $this->_lastName = $lastName;
|
---|
467 | break;
|
---|
468 | case $this->lookupNamespace('yt') . ':' . 'statistics':
|
---|
469 | $statistics = new Zend_Gdata_YouTube_Extension_Statistics();
|
---|
470 | $statistics->transferFromDOM($child);
|
---|
471 | $this->_statistics = $statistics;
|
---|
472 | break;
|
---|
473 | case $this->lookupNamespace('media') . ':' . 'thumbnail':
|
---|
474 | $thumbnail = new Zend_Gdata_Media_Extension_MediaThumbnail();
|
---|
475 | $thumbnail->transferFromDOM($child);
|
---|
476 | $this->_thumbnail = $thumbnail;
|
---|
477 | break;
|
---|
478 | case $this->lookupNamespace('gd') . ':' . 'feedLink':
|
---|
479 | $feedLink = new Zend_Gdata_Extension_FeedLink();
|
---|
480 | $feedLink->transferFromDOM($child);
|
---|
481 | $this->_feedLink[] = $feedLink;
|
---|
482 | break;
|
---|
483 | default:
|
---|
484 | parent::takeChildFromDOM($child);
|
---|
485 | break;
|
---|
486 | }
|
---|
487 | }
|
---|
488 |
|
---|
489 | /**
|
---|
490 | * Sets the content of the 'about me' field.
|
---|
491 | *
|
---|
492 | * @param Zend_Gdata_YouTube_Extension_AboutMe $aboutMe The 'about me'
|
---|
493 | * information.
|
---|
494 | * @throws Zend_Gdata_App_VersionException
|
---|
495 | * @return Zend_Gdata_YouTube_UserProfileEntry Provides a fluent interface
|
---|
496 | */
|
---|
497 | public function setAboutMe($aboutMe = null)
|
---|
498 | {
|
---|
499 | if (($this->getMajorProtocolVersion() == null) ||
|
---|
500 | ($this->getMajorProtocolVersion() == 1)) {
|
---|
501 | require_once 'Zend/Gdata/App/VersionException.php';
|
---|
502 | throw new Zend_Gdata_App_VersionException('The setAboutMe ' .
|
---|
503 | ' method is only supported as of version 2 of the YouTube ' .
|
---|
504 | 'API.');
|
---|
505 | } else {
|
---|
506 | $this->_aboutMe = $aboutMe;
|
---|
507 | return $this;
|
---|
508 | }
|
---|
509 | }
|
---|
510 |
|
---|
511 | /**
|
---|
512 | * Returns the contents of the 'about me' field.
|
---|
513 | *
|
---|
514 | * @throws Zend_Gdata_App_VersionException
|
---|
515 | * @return Zend_Gdata_YouTube_Extension_AboutMe The 'about me' information
|
---|
516 | */
|
---|
517 | public function getAboutMe()
|
---|
518 | {
|
---|
519 | if (($this->getMajorProtocolVersion() == null) ||
|
---|
520 | ($this->getMajorProtocolVersion() == 1)) {
|
---|
521 | require_once 'Zend/Gdata/App/VersionException.php';
|
---|
522 | throw new Zend_Gdata_App_VersionException('The getAboutMe ' .
|
---|
523 | ' method is only supported as of version 2 of the YouTube ' .
|
---|
524 | 'API.');
|
---|
525 | } else {
|
---|
526 | return $this->_aboutMe;
|
---|
527 | }
|
---|
528 | }
|
---|
529 |
|
---|
530 | /**
|
---|
531 | * Sets the content of the 'first name' field.
|
---|
532 | *
|
---|
533 | * @param Zend_Gdata_YouTube_Extension_FirstName $firstName The first name
|
---|
534 | * @throws Zend_Gdata_App_VersionException
|
---|
535 | * @return Zend_Gdata_YouTube_UserProfileEntry Provides a fluent interface
|
---|
536 | */
|
---|
537 | public function setFirstName($firstName = null)
|
---|
538 | {
|
---|
539 | if (($this->getMajorProtocolVersion() == null) ||
|
---|
540 | ($this->getMajorProtocolVersion() == 1)) {
|
---|
541 | require_once 'Zend/Gdata/App/VersionException.php';
|
---|
542 | throw new Zend_Gdata_App_VersionException('The setFirstName ' .
|
---|
543 | ' method is only supported as of version 2 of the YouTube ' .
|
---|
544 | 'API.');
|
---|
545 | } else {
|
---|
546 | $this->_firstName = $firstName;
|
---|
547 | return $this;
|
---|
548 | }
|
---|
549 | }
|
---|
550 |
|
---|
551 | /**
|
---|
552 | * Returns the first name
|
---|
553 | *
|
---|
554 | * @throws Zend_Gdata_App_VersionException
|
---|
555 | * @return Zend_Gdata_YouTube_Extension_FirstName The first name
|
---|
556 | */
|
---|
557 | public function getFirstName()
|
---|
558 | {
|
---|
559 | if (($this->getMajorProtocolVersion() == null) ||
|
---|
560 | ($this->getMajorProtocolVersion() == 1)) {
|
---|
561 | require_once 'Zend/Gdata/App/VersionException.php';
|
---|
562 | throw new Zend_Gdata_App_VersionException('The getFirstName ' .
|
---|
563 | ' method is only supported as of version 2 of the YouTube ' .
|
---|
564 | 'API.');
|
---|
565 | } else {
|
---|
566 | return $this->_firstName;
|
---|
567 | }
|
---|
568 | }
|
---|
569 |
|
---|
570 | /**
|
---|
571 | * Sets the content of the 'last name' field.
|
---|
572 | *
|
---|
573 | * @param Zend_Gdata_YouTube_Extension_LastName $lastName The last name
|
---|
574 | * @throws Zend_Gdata_App_VersionException
|
---|
575 | * @return Zend_Gdata_YouTube_UserProfileEntry Provides a fluent interface
|
---|
576 | */
|
---|
577 | public function setLastName($lastName = null)
|
---|
578 | {
|
---|
579 | if (($this->getMajorProtocolVersion() == null) ||
|
---|
580 | ($this->getMajorProtocolVersion() == 1)) {
|
---|
581 | require_once 'Zend/Gdata/App/VersionException.php';
|
---|
582 | throw new Zend_Gdata_App_VersionException('The setLastName ' .
|
---|
583 | ' method is only supported as of version 2 of the YouTube ' .
|
---|
584 | 'API.');
|
---|
585 | } else {
|
---|
586 | $this->_lastName = $lastName;
|
---|
587 | return $this;
|
---|
588 | }
|
---|
589 | }
|
---|
590 |
|
---|
591 | /**
|
---|
592 | * Returns the last name
|
---|
593 | *
|
---|
594 | * @throws Zend_Gdata_App_VersionException
|
---|
595 | * @return Zend_Gdata_YouTube_Extension_LastName The last name
|
---|
596 | */
|
---|
597 | public function getLastName()
|
---|
598 | {
|
---|
599 | if (($this->getMajorProtocolVersion() == null) ||
|
---|
600 | ($this->getMajorProtocolVersion() == 1)) {
|
---|
601 | require_once 'Zend/Gdata/App/VersionException.php';
|
---|
602 | throw new Zend_Gdata_App_VersionException('The getLastName ' .
|
---|
603 | ' method is only supported as of version 2 of the YouTube ' .
|
---|
604 | 'API.');
|
---|
605 | } else {
|
---|
606 | return $this->_lastName;
|
---|
607 | }
|
---|
608 | }
|
---|
609 |
|
---|
610 | /**
|
---|
611 | * Returns the statistics
|
---|
612 | *
|
---|
613 | * @throws Zend_Gdata_App_VersionException
|
---|
614 | * @return Zend_Gdata_YouTube_Extension_Statistics The profile statistics
|
---|
615 | */
|
---|
616 | public function getStatistics()
|
---|
617 | {
|
---|
618 | if (($this->getMajorProtocolVersion() == null) ||
|
---|
619 | ($this->getMajorProtocolVersion() == 1)) {
|
---|
620 | require_once 'Zend/Gdata/App/VersionException.php';
|
---|
621 | throw new Zend_Gdata_App_VersionException('The getStatistics ' .
|
---|
622 | ' method is only supported as of version 2 of the YouTube ' .
|
---|
623 | 'API.');
|
---|
624 | } else {
|
---|
625 | return $this->_statistics;
|
---|
626 | }
|
---|
627 | }
|
---|
628 |
|
---|
629 | /**
|
---|
630 | * Returns the thumbnail
|
---|
631 | *
|
---|
632 | * @throws Zend_Gdata_App_VersionException
|
---|
633 | * @return Zend_Gdata_Media_Extension_MediaThumbnail The profile thumbnail
|
---|
634 | */
|
---|
635 | public function getThumbnail()
|
---|
636 | {
|
---|
637 | if (($this->getMajorProtocolVersion() == null) ||
|
---|
638 | ($this->getMajorProtocolVersion() == 1)) {
|
---|
639 | require_once 'Zend/Gdata/App/VersionException.php';
|
---|
640 | throw new Zend_Gdata_App_VersionException('The getThumbnail ' .
|
---|
641 | ' method is only supported as of version 2 of the YouTube ' .
|
---|
642 | 'API.');
|
---|
643 | } else {
|
---|
644 | return $this->_thumbnail;
|
---|
645 | }
|
---|
646 | }
|
---|
647 |
|
---|
648 | /**
|
---|
649 | * Sets the age
|
---|
650 | *
|
---|
651 | * @param Zend_Gdata_YouTube_Extension_Age $age The age
|
---|
652 | * @return Zend_Gdata_YouTube_UserProfileEntry Provides a fluent interface
|
---|
653 | */
|
---|
654 | public function setAge($age = null)
|
---|
655 | {
|
---|
656 | $this->_age = $age;
|
---|
657 | return $this;
|
---|
658 | }
|
---|
659 |
|
---|
660 | /**
|
---|
661 | * Returns the age
|
---|
662 | *
|
---|
663 | * @return Zend_Gdata_YouTube_Extension_Age The age
|
---|
664 | */
|
---|
665 | public function getAge()
|
---|
666 | {
|
---|
667 | return $this->_age;
|
---|
668 | }
|
---|
669 |
|
---|
670 | /**
|
---|
671 | * Sets the username
|
---|
672 | *
|
---|
673 | * @param Zend_Gdata_YouTube_Extension_Username $username The username
|
---|
674 | * @return Zend_Gdata_YouTube_UserProfileEntry Provides a fluent interface
|
---|
675 | */
|
---|
676 | public function setUsername($username = null)
|
---|
677 | {
|
---|
678 | $this->_username = $username;
|
---|
679 | return $this;
|
---|
680 | }
|
---|
681 |
|
---|
682 | /**
|
---|
683 | * Returns the username
|
---|
684 | *
|
---|
685 | * @return Zend_Gdata_YouTube_Extension_Username The username
|
---|
686 | */
|
---|
687 | public function getUsername()
|
---|
688 | {
|
---|
689 | return $this->_username;
|
---|
690 | }
|
---|
691 |
|
---|
692 | /**
|
---|
693 | * Sets the books
|
---|
694 | *
|
---|
695 | * @param Zend_Gdata_YouTube_Extension_Books $books The books
|
---|
696 | * @return Zend_Gdata_YouTube_UserProfileEntry Provides a fluent interface
|
---|
697 | */
|
---|
698 | public function setBooks($books = null)
|
---|
699 | {
|
---|
700 | $this->_books = $books;
|
---|
701 | return $this;
|
---|
702 | }
|
---|
703 |
|
---|
704 | /**
|
---|
705 | * Returns the books
|
---|
706 | *
|
---|
707 | * @return Zend_Gdata_YouTube_Extension_Books The books
|
---|
708 | */
|
---|
709 | public function getBooks()
|
---|
710 | {
|
---|
711 | return $this->_books;
|
---|
712 | }
|
---|
713 |
|
---|
714 | /**
|
---|
715 | * Sets the company
|
---|
716 | *
|
---|
717 | * @param Zend_Gdata_YouTube_Extension_Company $company The company
|
---|
718 | * @return Zend_Gdata_YouTube_UserProfileEntry Provides a fluent interface
|
---|
719 | */
|
---|
720 | public function setCompany($company = null)
|
---|
721 | {
|
---|
722 | $this->_company = $company;
|
---|
723 | return $this;
|
---|
724 | }
|
---|
725 |
|
---|
726 | /**
|
---|
727 | * Returns the company
|
---|
728 | *
|
---|
729 | * @return Zend_Gdata_YouTube_Extension_Company The company
|
---|
730 | */
|
---|
731 | public function getCompany()
|
---|
732 | {
|
---|
733 | return $this->_company;
|
---|
734 | }
|
---|
735 |
|
---|
736 | /**
|
---|
737 | * Sets the hobbies
|
---|
738 | *
|
---|
739 | * @param Zend_Gdata_YouTube_Extension_Hobbies $hobbies The hobbies
|
---|
740 | * @return Zend_Gdata_YouTube_UserProfileEntry Provides a fluent interface
|
---|
741 | */
|
---|
742 | public function setHobbies($hobbies = null)
|
---|
743 | {
|
---|
744 | $this->_hobbies = $hobbies;
|
---|
745 | return $this;
|
---|
746 | }
|
---|
747 |
|
---|
748 | /**
|
---|
749 | * Returns the hobbies
|
---|
750 | *
|
---|
751 | * @return Zend_Gdata_YouTube_Extension_Hobbies The hobbies
|
---|
752 | */
|
---|
753 | public function getHobbies()
|
---|
754 | {
|
---|
755 | return $this->_hobbies;
|
---|
756 | }
|
---|
757 |
|
---|
758 | /**
|
---|
759 | * Sets the hometown
|
---|
760 | *
|
---|
761 | * @param Zend_Gdata_YouTube_Extension_Hometown $hometown The hometown
|
---|
762 | * @return Zend_Gdata_YouTube_UserProfileEntry Provides a fluent interface
|
---|
763 | */
|
---|
764 | public function setHometown($hometown = null)
|
---|
765 | {
|
---|
766 | $this->_hometown = $hometown;
|
---|
767 | return $this;
|
---|
768 | }
|
---|
769 |
|
---|
770 | /**
|
---|
771 | * Returns the hometown
|
---|
772 | *
|
---|
773 | * @return Zend_Gdata_YouTube_Extension_Hometown The hometown
|
---|
774 | */
|
---|
775 | public function getHometown()
|
---|
776 | {
|
---|
777 | return $this->_hometown;
|
---|
778 | }
|
---|
779 |
|
---|
780 | /**
|
---|
781 | * Sets the location
|
---|
782 | *
|
---|
783 | * @param Zend_Gdata_YouTube_Extension_Location $location The location
|
---|
784 | * @return Zend_Gdata_YouTube_UserProfileEntry Provides a fluent interface
|
---|
785 | */
|
---|
786 | public function setLocation($location = null)
|
---|
787 | {
|
---|
788 | $this->_location = $location;
|
---|
789 | return $this;
|
---|
790 | }
|
---|
791 |
|
---|
792 | /**
|
---|
793 | * Returns the location
|
---|
794 | *
|
---|
795 | * @return Zend_Gdata_YouTube_Extension_Location The location
|
---|
796 | */
|
---|
797 | public function getLocation()
|
---|
798 | {
|
---|
799 | return $this->_location;
|
---|
800 | }
|
---|
801 |
|
---|
802 | /**
|
---|
803 | * Sets the movies
|
---|
804 | *
|
---|
805 | * @param Zend_Gdata_YouTube_Extension_Movies $movies The movies
|
---|
806 | * @return Zend_Gdata_YouTube_UserProfileEntry Provides a fluent interface
|
---|
807 | */
|
---|
808 | public function setMovies($movies = null)
|
---|
809 | {
|
---|
810 | $this->_movies = $movies;
|
---|
811 | return $this;
|
---|
812 | }
|
---|
813 |
|
---|
814 | /**
|
---|
815 | * Returns the movies
|
---|
816 | *
|
---|
817 | * @return Zend_Gdata_YouTube_Extension_Movies The movies
|
---|
818 | */
|
---|
819 | public function getMovies()
|
---|
820 | {
|
---|
821 | return $this->_movies;
|
---|
822 | }
|
---|
823 |
|
---|
824 | /**
|
---|
825 | * Sets the music
|
---|
826 | *
|
---|
827 | * @param Zend_Gdata_YouTube_Extension_Music $music The music
|
---|
828 | * @return Zend_Gdata_YouTube_UserProfileEntry Provides a fluent interface
|
---|
829 | */
|
---|
830 | public function setMusic($music = null)
|
---|
831 | {
|
---|
832 | $this->_music = $music;
|
---|
833 | return $this;
|
---|
834 | }
|
---|
835 |
|
---|
836 | /**
|
---|
837 | * Returns the music
|
---|
838 | *
|
---|
839 | * @return Zend_Gdata_YouTube_Extension_Music The music
|
---|
840 | */
|
---|
841 | public function getMusic()
|
---|
842 | {
|
---|
843 | return $this->_music;
|
---|
844 | }
|
---|
845 |
|
---|
846 | /**
|
---|
847 | * Sets the occupation
|
---|
848 | *
|
---|
849 | * @param Zend_Gdata_YouTube_Extension_Occupation $occupation The occupation
|
---|
850 | * @return Zend_Gdata_YouTube_UserProfileEntry Provides a fluent interface
|
---|
851 | */
|
---|
852 | public function setOccupation($occupation = null)
|
---|
853 | {
|
---|
854 | $this->_occupation = $occupation;
|
---|
855 | return $this;
|
---|
856 | }
|
---|
857 |
|
---|
858 | /**
|
---|
859 | * Returns the occupation
|
---|
860 | *
|
---|
861 | * @return Zend_Gdata_YouTube_Extension_Occupation The occupation
|
---|
862 | */
|
---|
863 | public function getOccupation()
|
---|
864 | {
|
---|
865 | return $this->_occupation;
|
---|
866 | }
|
---|
867 |
|
---|
868 | /**
|
---|
869 | * Sets the school
|
---|
870 | *
|
---|
871 | * @param Zend_Gdata_YouTube_Extension_School $school The school
|
---|
872 | * @return Zend_Gdata_YouTube_UserProfileEntry Provides a fluent interface
|
---|
873 | */
|
---|
874 | public function setSchool($school = null)
|
---|
875 | {
|
---|
876 | $this->_school = $school;
|
---|
877 | return $this;
|
---|
878 | }
|
---|
879 |
|
---|
880 | /**
|
---|
881 | * Returns the school
|
---|
882 | *
|
---|
883 | * @return Zend_Gdata_YouTube_Extension_School The school
|
---|
884 | */
|
---|
885 | public function getSchool()
|
---|
886 | {
|
---|
887 | return $this->_school;
|
---|
888 | }
|
---|
889 |
|
---|
890 | /**
|
---|
891 | * Sets the gender
|
---|
892 | *
|
---|
893 | * @param Zend_Gdata_YouTube_Extension_Gender $gender The gender
|
---|
894 | * @return Zend_Gdata_YouTube_UserProfileEntry Provides a fluent interface
|
---|
895 | */
|
---|
896 | public function setGender($gender = null)
|
---|
897 | {
|
---|
898 | $this->_gender = $gender;
|
---|
899 | return $this;
|
---|
900 | }
|
---|
901 |
|
---|
902 | /**
|
---|
903 | * Returns the gender
|
---|
904 | *
|
---|
905 | * @return Zend_Gdata_YouTube_Extension_Gender The gender
|
---|
906 | */
|
---|
907 | public function getGender()
|
---|
908 | {
|
---|
909 | return $this->_gender;
|
---|
910 | }
|
---|
911 |
|
---|
912 | /**
|
---|
913 | * Sets the relationship
|
---|
914 | *
|
---|
915 | * @param Zend_Gdata_YouTube_Extension_Relationship $relationship The relationship
|
---|
916 | * @return Zend_Gdata_YouTube_UserProfileEntry Provides a fluent interface
|
---|
917 | */
|
---|
918 | public function setRelationship($relationship = null)
|
---|
919 | {
|
---|
920 | $this->_relationship = $relationship;
|
---|
921 | return $this;
|
---|
922 | }
|
---|
923 |
|
---|
924 | /**
|
---|
925 | * Returns the relationship
|
---|
926 | *
|
---|
927 | * @return Zend_Gdata_YouTube_Extension_Relationship The relationship
|
---|
928 | */
|
---|
929 | public function getRelationship()
|
---|
930 | {
|
---|
931 | return $this->_relationship;
|
---|
932 | }
|
---|
933 |
|
---|
934 | /**
|
---|
935 | * Sets the array of embedded feeds related to the video
|
---|
936 | *
|
---|
937 | * @param array $feedLink The array of embedded feeds relating to the video
|
---|
938 | * @return Zend_Gdata_YouTube_UserProfileEntry Provides a fluent interface
|
---|
939 | */
|
---|
940 | public function setFeedLink($feedLink = null)
|
---|
941 | {
|
---|
942 | $this->_feedLink = $feedLink;
|
---|
943 | return $this;
|
---|
944 | }
|
---|
945 |
|
---|
946 | /**
|
---|
947 | * Get the feed link property for this entry.
|
---|
948 | *
|
---|
949 | * @see setFeedLink
|
---|
950 | * @param string $rel (optional) The rel value of the link to be found.
|
---|
951 | * If null, the array of links is returned.
|
---|
952 | * @return mixed If $rel is specified, a Zend_Gdata_Extension_FeedLink
|
---|
953 | * object corresponding to the requested rel value is returned
|
---|
954 | * if found, or null if the requested value is not found. If
|
---|
955 | * $rel is null or not specified, an array of all available
|
---|
956 | * feed links for this entry is returned, or null if no feed
|
---|
957 | * links are set.
|
---|
958 | */
|
---|
959 | public function getFeedLink($rel = null)
|
---|
960 | {
|
---|
961 | if ($rel == null) {
|
---|
962 | return $this->_feedLink;
|
---|
963 | } else {
|
---|
964 | foreach ($this->_feedLink as $feedLink) {
|
---|
965 | if ($feedLink->rel == $rel) {
|
---|
966 | return $feedLink;
|
---|
967 | }
|
---|
968 | }
|
---|
969 | return null;
|
---|
970 | }
|
---|
971 | }
|
---|
972 |
|
---|
973 | /**
|
---|
974 | * Returns the URL in the gd:feedLink with the provided rel value
|
---|
975 | *
|
---|
976 | * @param string $rel The rel value to find
|
---|
977 | * @return mixed Either the URL as a string or null if a feedLink wasn't
|
---|
978 | * found with the provided rel value
|
---|
979 | */
|
---|
980 | public function getFeedLinkHref($rel)
|
---|
981 | {
|
---|
982 | $feedLink = $this->getFeedLink($rel);
|
---|
983 | if ($feedLink !== null) {
|
---|
984 | return $feedLink->href;
|
---|
985 | } else {
|
---|
986 | return null;
|
---|
987 | }
|
---|
988 | }
|
---|
989 |
|
---|
990 | /**
|
---|
991 | * Returns the URL of the playlist list feed
|
---|
992 | *
|
---|
993 | * @return string The URL of the playlist video feed
|
---|
994 | */
|
---|
995 | public function getPlaylistListFeedUrl()
|
---|
996 | {
|
---|
997 | return getFeedLinkHref(Zend_Gdata_YouTube::USER_PLAYLISTS_REL);
|
---|
998 | }
|
---|
999 |
|
---|
1000 | /**
|
---|
1001 | * Returns the URL of the uploads feed
|
---|
1002 | *
|
---|
1003 | * @return string The URL of the uploads video feed
|
---|
1004 | */
|
---|
1005 | public function getUploadsFeedUrl()
|
---|
1006 | {
|
---|
1007 | return getFeedLinkHref(Zend_Gdata_YouTube::USER_UPLOADS_REL);
|
---|
1008 | }
|
---|
1009 |
|
---|
1010 | /**
|
---|
1011 | * Returns the URL of the subscriptions feed
|
---|
1012 | *
|
---|
1013 | * @return string The URL of the subscriptions feed
|
---|
1014 | */
|
---|
1015 | public function getSubscriptionsFeedUrl()
|
---|
1016 | {
|
---|
1017 | return getFeedLinkHref(Zend_Gdata_YouTube::USER_SUBSCRIPTIONS_REL);
|
---|
1018 | }
|
---|
1019 |
|
---|
1020 | /**
|
---|
1021 | * Returns the URL of the contacts feed
|
---|
1022 | *
|
---|
1023 | * @return string The URL of the contacts feed
|
---|
1024 | */
|
---|
1025 | public function getContactsFeedUrl()
|
---|
1026 | {
|
---|
1027 | return getFeedLinkHref(Zend_Gdata_YouTube::USER_CONTACTS_REL);
|
---|
1028 | }
|
---|
1029 |
|
---|
1030 | /**
|
---|
1031 | * Returns the URL of the favorites feed
|
---|
1032 | *
|
---|
1033 | * @return string The URL of the favorites feed
|
---|
1034 | */
|
---|
1035 | public function getFavoritesFeedUrl()
|
---|
1036 | {
|
---|
1037 | return getFeedLinkHref(Zend_Gdata_YouTube::USER_FAVORITES_REL);
|
---|
1038 | }
|
---|
1039 |
|
---|
1040 | }
|
---|