diff -r 5b37998e522e -r 162c1de6545a web/lib/Zend/Gdata/App/Extension/Link.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Gdata/App/Extension/Link.php Fri Mar 11 15:05:35 2011 +0100 @@ -0,0 +1,219 @@ +_href = $href; + $this->_rel = $rel; + $this->_type = $type; + $this->_hrefLang = $hrefLang; + $this->_title = $title; + $this->_length = $length; + } + + public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) + { + $element = parent::getDOM($doc, $majorVersion, $minorVersion); + if ($this->_href !== null) { + $element->setAttribute('href', $this->_href); + } + if ($this->_rel !== null) { + $element->setAttribute('rel', $this->_rel); + } + if ($this->_type !== null) { + $element->setAttribute('type', $this->_type); + } + if ($this->_hrefLang !== null) { + $element->setAttribute('hreflang', $this->_hrefLang); + } + if ($this->_title !== null) { + $element->setAttribute('title', $this->_title); + } + if ($this->_length !== null) { + $element->setAttribute('length', $this->_length); + } + return $element; + } + + protected function takeAttributeFromDOM($attribute) + { + switch ($attribute->localName) { + case 'href': + $this->_href = $attribute->nodeValue; + break; + case 'rel': + $this->_rel = $attribute->nodeValue; + break; + case 'type': + $this->_type = $attribute->nodeValue; + break; + case 'hreflang': + $this->_hrefLang = $attribute->nodeValue; + break; + case 'title': + $this->_title = $attribute->nodeValue; + break; + case 'length': + $this->_length = $attribute->nodeValue; + break; + default: + parent::takeAttributeFromDOM($attribute); + } + } + + /** + * @return string|null + */ + public function getHref() + { + return $this->_href; + } + + /** + * @param string|null $value + * @return Zend_Gdata_App_Entry Provides a fluent interface + */ + public function setHref($value) + { + $this->_href = $value; + return $this; + } + + /** + * @return string|null + */ + public function getRel() + { + return $this->_rel; + } + + /** + * @param string|null $value + * @return Zend_Gdata_App_Entry Provides a fluent interface + */ + public function setRel($value) + { + $this->_rel = $value; + return $this; + } + + /** + * @return string|null + */ + public function getType() + { + return $this->_type; + } + + /** + * @param string|null $value + * @return Zend_Gdata_App_Entry Provides a fluent interface + */ + public function setType($value) + { + $this->_type = $value; + return $this; + } + + /** + * @return string|null + */ + public function getHrefLang() + { + return $this->_hrefLang; + } + + /** + * @param string|null $value + * @return Zend_Gdata_App_Entry Provides a fluent interface + */ + public function setHrefLang($value) + { + $this->_hrefLang = $value; + return $this; + } + + /** + * @return string|null + */ + public function getTitle() + { + return $this->_title; + } + + /** + * @param string|null $value + * @return Zend_Gdata_App_Entry Provides a fluent interface + */ + public function setTitle($value) + { + $this->_title = $value; + return $this; + } + + /** + * @return string|null + */ + public function getLength() + { + return $this->_length; + } + + /** + * @param string|null $value + * @return Zend_Gdata_App_Entry Provides a fluent interface + */ + public function setLength($value) + { + $this->_length = $value; + return $this; + } + +}