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.
19 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
20 * @license http://framework.zend.com/license/new-bsd New BSD License
25 * @see Zend_Gdata_YouTube_VideoEntry
27 require_once 'Zend/Gdata/YouTube/VideoEntry.php';
30 * @see Zend_Gdata_YouTube_Extension_Position
32 require_once 'Zend/Gdata/YouTube/Extension/Position.php';
35 * Represents the YouTube video playlist flavor of an Atom entry
40 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
41 * @license http://framework.zend.com/license/new-bsd New BSD License
43 class Zend_Gdata_YouTube_PlaylistVideoEntry extends Zend_Gdata_YouTube_VideoEntry
46 protected $_entryClassName = 'Zend_Gdata_YouTube_PlaylistVideoEntry';
49 * Position of the entry in the feed, as specified by the user
51 * @var Zend_Gdata_YouTube_Extension_Position
53 protected $_position = null;
56 * Creates a Playlist video entry, representing an individual video
57 * in a list of videos contained within a specific playlist
59 * @param DOMElement $element (optional) DOMElement from which this
60 * object should be constructed.
62 public function __construct($element = null)
64 $this->registerAllNamespaces(Zend_Gdata_YouTube::$namespaces);
65 parent::__construct($element);
69 * Retrieves a DOMElement which corresponds to this element and all
70 * child properties. This is used to build an entry back into a DOM
71 * and eventually XML text for sending to the server upon updates, or
72 * for application storage/persistence.
74 * @param DOMDocument $doc The DOMDocument used to construct DOMElements
75 * @return DOMElement The DOMElement representing this element and all
78 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
80 $element = parent::getDOM($doc, $majorVersion, $minorVersion);
81 if ($this->_position !== null) {
82 $element->appendChild($this->_position->getDOM($element->ownerDocument));
88 * Creates individual Entry objects of the appropriate type and
89 * stores them in the $_entry array based upon DOM data.
91 * @param DOMNode $child The DOMNode to process
93 protected function takeChildFromDOM($child)
95 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
96 switch ($absoluteNodeName) {
97 case $this->lookupNamespace('yt') . ':' . 'position':
98 $position = new Zend_Gdata_YouTube_Extension_Position();
99 $position->transferFromDOM($child);
100 $this->_position = $position;
103 parent::takeChildFromDOM($child);
110 * Sets the array of embedded feeds related to the video
112 * @param Zend_Gdata_YouTube_Extension_Position $position
113 * The position of the entry in the feed, as specified by the user.
114 * @return Zend_Gdata_YouTube_PlaylistVideoEntry Provides a fluent interface
116 public function setPosition($position = null)
118 $this->_position = $position;
123 * Returns the position of the entry in the feed, as specified by the user
125 * @return Zend_Gdata_YouTube_Extension_Position The position
127 public function getPosition()
129 return $this->_position;