Merge file:///media/external_data/workspace/web/sport-group
[sport-group.git] / library / Zend / Gdata / Extension / ExtendedProperty.php
blob4413f490c72ff1e800fab87c0b8ce3406e1d81d7
1 <?php
3 /**
4 * Zend Framework
6 * LICENSE
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.
16 * @category Zend
17 * @package Zend_Gdata
18 * @subpackage Gdata
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 $
24 /**
25 * @see Zend_Gdata_Extension
27 require_once 'Zend/Gdata/Extension.php';
29 /**
30 * Data model for gd:extendedProperty element, used by some Gdata
31 * services to implement arbitrary name/value pair storage
33 * @category Zend
34 * @package Zend_Gdata
35 * @subpackage Gdata
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();
49 $this->_name = $name;
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);
62 return $element;
65 protected function takeAttributeFromDOM($attribute)
67 switch ($attribute->localName) {
68 case 'name':
69 $this->_name = $attribute->nodeValue;
70 break;
71 case 'value':
72 $this->_value = $attribute->nodeValue;
73 break;
74 default:
75 parent::takeAttributeFromDOM($attribute);
79 public function __toString()
81 return $this->getName() . '=' . $this->getValue();
84 public function getName()
86 return $this->_name;
89 public function setName($value)
91 $this->_name = $value;
92 return $this;
95 public function getValue()
97 return $this->_value;
100 public function setValue($value)
102 $this->_value = $value;
103 return $this;