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-2009 Zend Technologies USA Inc. (http://www.zend.com)
20 * @license http://framework.zend.com/license/new-bsd New BSD License
21 * @version $Id: ExtendedProperty.php 16971 2009-07-22 18:05:45Z mikaelkael $
25 * @see Zend_Gdata_Extension
27 require_once 'Zend/Gdata/Extension.php';
30 * Data model for gd:extendedProperty element, used by some Gdata
31 * services to implement arbitrary name/value pair storage
36 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
37 * @license http://framework.zend.com/license/new-bsd New BSD License
39 class Zend_Gdata_Extension_ExtendedProperty
extends Zend_Gdata_Extension
42 protected $_rootElement = 'extendedProperty';
43 protected $_name = null;
44 protected $_value = null;
46 public function __construct($name = null, $value = null)
48 parent
::__construct();
50 $this->_value
= $value;
53 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
55 $element = parent
::getDOM($doc, $majorVersion, $minorVersion);
56 if ($this->_name
!== null) {
57 $element->setAttribute('name', $this->_name
);
59 if ($this->_value
!== null) {
60 $element->setAttribute('value', $this->_value
);
65 protected function takeAttributeFromDOM($attribute)
67 switch ($attribute->localName
) {
69 $this->_name
= $attribute->nodeValue
;
72 $this->_value
= $attribute->nodeValue
;
75 parent
::takeAttributeFromDOM($attribute);
79 public function __toString()
81 return $this->getName() . '=' . $this->getValue();
84 public function getName()
89 public function setName($value)
91 $this->_name
= $value;
95 public function getValue()
100 public function setValue($value)
102 $this->_value
= $value;