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-2010 Zend Technologies USA Inc. (http://www.zend.com)
20 * @license http://framework.zend.com/license/new-bsd New BSD License
25 * @see Zend_Gdata_App_Extension
27 require_once 'Zend/Gdata/App/Extension.php';
30 * Represents the atom:category element
35 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
36 * @license http://framework.zend.com/license/new-bsd New BSD License
38 class Zend_Gdata_App_Extension_Category extends Zend_Gdata_App_Extension
41 protected $_rootElement = 'category';
42 protected $_term = null;
43 protected $_scheme = null;
44 protected $_label = null;
46 public function __construct($term = null, $scheme = null, $label=null)
48 parent::__construct();
50 $this->_scheme = $scheme;
51 $this->_label = $label;
54 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
56 $element = parent::getDOM($doc, $majorVersion, $minorVersion);
57 if ($this->_term !== null) {
58 $element->setAttribute('term', $this->_term);
60 if ($this->_scheme !== null) {
61 $element->setAttribute('scheme', $this->_scheme);
63 if ($this->_label !== null) {
64 $element->setAttribute('label', $this->_label);
69 protected function takeAttributeFromDOM($attribute)
71 switch ($attribute->localName) {
73 $this->_term = $attribute->nodeValue;
76 $this->_scheme = $attribute->nodeValue;
79 $this->_label = $attribute->nodeValue;
82 parent::takeAttributeFromDOM($attribute);
89 public function getTerm()
95 * @param string|null $value
96 * @return Zend_Gdata_App_Extension_Category Provides a fluent interface
98 public function setTerm($value)
100 $this->_term = $value;
105 * @return string|null
107 public function getScheme()
109 return $this->_scheme;
113 * @param string|null $value
114 * @return Zend_Gdata_App_Extension_Category Provides a fluent interface
116 public function setScheme($value)
118 $this->_scheme = $value;
123 * @return string|null
125 public function getLabel()
127 return $this->_label;
131 * @param string|null $value
132 * @return Zend_Gdata_App_Extension_Category Provides a fluent interface
134 public function setLabel($value)
136 $this->_label = $value;