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_UserProfileEntry
27 require_once 'Zend/Gdata/YouTube/UserProfileEntry.php';
30 * @see Zend_Gdata_YouTube_Extension_Status
32 require_once 'Zend/Gdata/YouTube/Extension/Status.php';
35 * The YouTube contacts flavor of an Atom Entry with media support
36 * Represents a an individual contact
41 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
42 * @license http://framework.zend.com/license/new-bsd New BSD License
44 class Zend_Gdata_YouTube_ContactEntry extends Zend_Gdata_YouTube_UserProfileEntry
48 * The classname for individual feed elements.
52 protected $_entryClassName = 'Zend_Gdata_YouTube_ContactEntry';
55 * Status of the user as a contact
59 protected $_status = null;
62 * Constructs a new Contact Entry object, to represent
63 * an individual contact for a user
65 * @param DOMElement $element (optional) DOMElement from which this
66 * object should be constructed.
68 public function __construct($element = null)
70 $this->registerAllNamespaces(Zend_Gdata_YouTube::$namespaces);
71 parent::__construct($element);
75 * Retrieves a DOMElement which corresponds to this element and all
76 * child properties. This is used to build an entry back into a DOM
77 * and eventually XML text for sending to the server upon updates, or
78 * for application storage/persistence.
80 * @param DOMDocument $doc The DOMDocument used to construct DOMElements
81 * @return DOMElement The DOMElement representing this element and all
84 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
86 $element = parent::getDOM($doc, $majorVersion, $minorVersion);
87 if ($this->_status != null) {
88 $element->appendChild($this->_status->getDOM($element->ownerDocument));
94 * Creates individual Entry objects of the appropriate type and
95 * stores them in the $_entry array based upon DOM data.
97 * @param DOMNode $child The DOMNode to process
99 protected function takeChildFromDOM($child)
101 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
102 switch ($absoluteNodeName) {
103 case $this->lookupNamespace('yt') . ':' . 'status':
104 $status = new Zend_Gdata_YouTube_Extension_Status();
105 $status->transferFromDOM($child);
106 $this->_status = $status;
109 parent::takeChildFromDOM($child);
117 * @param Zend_Gdata_YouTube_Extension_Status $status The status
118 * @return Zend_Gdata_YouTube_ContactEntry Provides a fluent interface
120 public function setStatus($status = null)
122 $this->_status = $status;
129 * @return Zend_Gdata_YouTube_Extension_Status The status
131 public function getStatus()
133 return $this->_status;