MediaEntry.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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-2015 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. /**
  23. * @see Zend_Gdata_Media
  24. */
  25. require_once 'Zend/Gdata/Media.php';
  26. /**
  27. * @see Zend_Gdata_Media_Entry
  28. */
  29. require_once 'Zend/Gdata/Media/Entry.php';
  30. /**
  31. * @see Zend_Gdata_YouTube_Extension_MediaGroup
  32. */
  33. require_once 'Zend/Gdata/YouTube/Extension/MediaGroup.php';
  34. /**
  35. * Represents the YouTube flavor of a Gdata Media Entry
  36. *
  37. * @category Zend
  38. * @package Zend_Gdata
  39. * @subpackage YouTube
  40. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  41. * @license http://framework.zend.com/license/new-bsd New BSD License
  42. */
  43. class Zend_Gdata_YouTube_MediaEntry extends Zend_Gdata_Media_Entry
  44. {
  45. protected $_entryClassName = 'Zend_Gdata_YouTube_MediaEntry';
  46. /**
  47. * media:group element
  48. *
  49. * @var Zend_Gdata_YouTube_Extension_MediaGroup
  50. */
  51. protected $_mediaGroup = null;
  52. /**
  53. * Creates individual Entry objects of the appropriate type and
  54. * stores them as members of this entry based upon DOM data.
  55. *
  56. * @param DOMNode $child The DOMNode to process
  57. */
  58. protected function takeChildFromDOM($child)
  59. {
  60. $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
  61. switch ($absoluteNodeName) {
  62. case $this->lookupNamespace('media') . ':' . 'group':
  63. $mediaGroup = new Zend_Gdata_YouTube_Extension_MediaGroup();
  64. $mediaGroup->transferFromDOM($child);
  65. $this->_mediaGroup = $mediaGroup;
  66. break;
  67. default:
  68. parent::takeChildFromDOM($child);
  69. break;
  70. }
  71. }
  72. }