|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00027 require_once 'Zend/Gdata/App/Extension.php'; 00028 00038 class Zend_Gdata_Media_Extension_MediaCategory extends Zend_Gdata_Extension 00039 { 00040 00041 protected $_rootElement = 'category'; 00042 protected $_rootNamespace = 'media'; 00043 00047 protected $_scheme = null; 00048 protected $_label = null; 00049 00057 public function __construct($text = null, $scheme = null, $label = null) 00058 { 00059 $this->registerAllNamespaces(Zend_Gdata_Media::$namespaces); 00060 parent::__construct(); 00061 $this->_text = $text; 00062 $this->_scheme = $scheme; 00063 $this->_label = $label; 00064 } 00065 00076 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 00077 { 00078 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 00079 if ($this->_scheme !== null) { 00080 $element->setAttribute('scheme', $this->_scheme); 00081 } 00082 if ($this->_label !== null) { 00083 $element->setAttribute('label', $this->_label); 00084 } 00085 return $element; 00086 } 00087 00095 protected function takeAttributeFromDOM($attribute) 00096 { 00097 switch ($attribute->localName) { 00098 case 'scheme': 00099 $this->_scheme = $attribute->nodeValue; 00100 break; 00101 case 'label': 00102 $this->_label = $attribute->nodeValue; 00103 break; 00104 default: 00105 parent::takeAttributeFromDOM($attribute); 00106 } 00107 } 00108 00115 public function getScheme() 00116 { 00117 return $this->_scheme; 00118 } 00119 00124 public function setScheme($value) 00125 { 00126 $this->_scheme = $value; 00127 return $this; 00128 } 00129 00133 public function getLabel() 00134 { 00135 return $this->_label; 00136 } 00137 00142 public function setLabel($value) 00143 { 00144 $this->_label = $value; 00145 return $this; 00146 } 00147 00148 }