From 06f945f27840b53e57795dadbc38e76f7e11ab1c Mon Sep 17 00:00:00 2001 From: Horus3 Date: Mon, 24 Feb 2014 16:42:14 +0100 Subject: init --- .../Zend/Gdata/Extension/ExtendedProperty.php | 106 +++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 zend/library/Zend/Gdata/Extension/ExtendedProperty.php (limited to 'zend/library/Zend/Gdata/Extension/ExtendedProperty.php') diff --git a/zend/library/Zend/Gdata/Extension/ExtendedProperty.php b/zend/library/Zend/Gdata/Extension/ExtendedProperty.php new file mode 100644 index 0000000..5df6a47 --- /dev/null +++ b/zend/library/Zend/Gdata/Extension/ExtendedProperty.php @@ -0,0 +1,106 @@ +_name = $name; + $this->_value = $value; + } + + public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) + { + $element = parent::getDOM($doc, $majorVersion, $minorVersion); + if ($this->_name !== null) { + $element->setAttribute('name', $this->_name); + } + if ($this->_value !== null) { + $element->setAttribute('value', $this->_value); + } + return $element; + } + + protected function takeAttributeFromDOM($attribute) + { + switch ($attribute->localName) { + case 'name': + $this->_name = $attribute->nodeValue; + break; + case 'value': + $this->_value = $attribute->nodeValue; + break; + default: + parent::takeAttributeFromDOM($attribute); + } + } + + public function __toString() + { + return $this->getName() . '=' . $this->getValue(); + } + + public function getName() + { + return $this->_name; + } + + public function setName($value) + { + $this->_name = $value; + return $this; + } + + public function getValue() + { + return $this->_value; + } + + public function setValue($value) + { + $this->_value = $value; + return $this; + } + +} -- cgit v1.2.3