From 06f945f27840b53e57795dadbc38e76f7e11ab1c Mon Sep 17 00:00:00 2001 From: Horus3 Date: Mon, 24 Feb 2014 16:42:14 +0100 Subject: init --- zend/library/Zend/Gdata/YouTube/ContactEntry.php | 136 +++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 zend/library/Zend/Gdata/YouTube/ContactEntry.php (limited to 'zend/library/Zend/Gdata/YouTube/ContactEntry.php') diff --git a/zend/library/Zend/Gdata/YouTube/ContactEntry.php b/zend/library/Zend/Gdata/YouTube/ContactEntry.php new file mode 100644 index 0000000..50503bf --- /dev/null +++ b/zend/library/Zend/Gdata/YouTube/ContactEntry.php @@ -0,0 +1,136 @@ +registerAllNamespaces(Zend_Gdata_YouTube::$namespaces); + parent::__construct($element); + } + + /** + * Retrieves a DOMElement which corresponds to this element and all + * child properties. This is used to build an entry back into a DOM + * and eventually XML text for sending to the server upon updates, or + * for application storage/persistence. + * + * @param DOMDocument $doc The DOMDocument used to construct DOMElements + * @return DOMElement The DOMElement representing this element and all + * child properties. + */ + public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) + { + $element = parent::getDOM($doc, $majorVersion, $minorVersion); + if ($this->_status != null) { + $element->appendChild($this->_status->getDOM($element->ownerDocument)); + } + return $element; + } + + /** + * Creates individual Entry objects of the appropriate type and + * stores them in the $_entry array based upon DOM data. + * + * @param DOMNode $child The DOMNode to process + */ + protected function takeChildFromDOM($child) + { + $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; + switch ($absoluteNodeName) { + case $this->lookupNamespace('yt') . ':' . 'status': + $status = new Zend_Gdata_YouTube_Extension_Status(); + $status->transferFromDOM($child); + $this->_status = $status; + break; + default: + parent::takeChildFromDOM($child); + break; + } + } + + /** + * Sets the status + * + * @param Zend_Gdata_YouTube_Extension_Status $status The status + * @return Zend_Gdata_YouTube_ContactEntry Provides a fluent interface + */ + public function setStatus($status = null) + { + $this->_status = $status; + return $this; + } + + /** + * Returns the status + * + * @return Zend_Gdata_YouTube_Extension_Status The status + */ + public function getStatus() + { + return $this->_status; + } + +} -- cgit v1.2.3