MediaEntry.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Gdata
  17. * @subpackage YouTube
  18. * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. */
  21. /**
  22. * @see Zend_Gdata_Media
  23. */
  24. require_once 'Zend/Gdata/Media.php';
  25. /**
  26. * @see Zend_Gdata_Media_Entry
  27. */
  28. require_once 'Zend/Gdata/Media/Entry.php';
  29. /**
  30. * @see Zend_Gdata_YouTube_Extension_MediaGroup
  31. */
  32. require_once 'Zend/Gdata/YouTube/Extension/MediaGroup.php';
  33. /**
  34. * Represents the YouTube flavor of a Gdata Media Entry
  35. *
  36. * @category Zend
  37. * @package Zend_Gdata
  38. * @subpackage YouTube
  39. * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
  40. * @license http://framework.zend.com/license/new-bsd New BSD License
  41. */
  42. class Zend_Gdata_YouTube_MediaEntry extends Zend_Gdata_Media_Entry
  43. {
  44. protected $_entryClassName = 'Zend_Gdata_YouTube_MediaEntry';
  45. /**
  46. * media:group element
  47. *
  48. * @var Zend_Gdata_YouTube_Extension_MediaGroup
  49. */
  50. protected $_mediaGroup = null;
  51. /**
  52. * Creates individual Entry objects of the appropriate type and
  53. * stores them as members of this entry based upon DOM data.
  54. *
  55. * @param DOMNode $child The DOMNode to process
  56. */
  57. protected function takeChildFromDOM($child)
  58. {
  59. $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
  60. switch ($absoluteNodeName) {
  61. case $this->lookupNamespace('media') . ':' . 'group':
  62. $mediaGroup = new Zend_Gdata_YouTube_Extension_MediaGroup();
  63. $mediaGroup->transferFromDOM($child);
  64. $this->_mediaGroup = $mediaGroup;
  65. break;
  66. default:
  67. parent::takeChildFromDOM($child);
  68. break;
  69. }
  70. }
  71. }