|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00027 require_once 'Zend/Gdata/Extension.php'; 00028 00038 class Zend_Gdata_YouTube_Extension_State extends Zend_Gdata_Extension 00039 { 00040 00041 protected $_rootNamespace = 'yt'; 00042 protected $_rootElement = 'state'; 00043 protected $_name = null; 00044 protected $_reasonCode = null; 00045 protected $_helpUrl = null; 00046 00055 public function __construct($explanation = null, $name = null, 00056 $reasonCode = null, $helpUrl = null) 00057 { 00058 $this->registerAllNamespaces(Zend_Gdata_YouTube::$namespaces); 00059 parent::__construct(); 00060 $this->_text = $explanation; 00061 $this->_name = $name; 00062 $this->_reasonCode = $reasonCode; 00063 $this->_helpUrl = $reasonCode; 00064 } 00065 00076 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 00077 { 00078 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 00079 if ($this->_name !== null) { 00080 $element->setAttribute('name', $this->_name); 00081 } 00082 if ($this->_reasonCode !== null) { 00083 $element->setAttribute('reasonCode', $this->_reasonCode); 00084 } 00085 if ($this->_helpUrl !== null) { 00086 $element->setAttribute('helpUrl', $this->_helpUrl); 00087 } 00088 return $element; 00089 } 00090 00099 protected function takeAttributeFromDOM($attribute) 00100 { 00101 switch ($attribute->localName) { 00102 case 'name': 00103 $this->_name = $attribute->nodeValue; 00104 break; 00105 case 'reasonCode': 00106 $this->_reasonCode = $attribute->nodeValue; 00107 break; 00108 case 'helpUrl': 00109 $this->_helpUrl = $attribute->nodeValue; 00110 break; 00111 default: 00112 parent::takeAttributeFromDOM($attribute); 00113 } 00114 } 00115 00121 public function getName() 00122 { 00123 return $this->_name; 00124 } 00125 00132 public function setName($value) 00133 { 00134 $this->_name = $value; 00135 return $this; 00136 } 00137 00143 public function getReasonCode() 00144 { 00145 return $this->_reasonCode; 00146 } 00147 00154 public function setReasonCode($value) 00155 { 00156 $this->_reasonCode = $value; 00157 return $this; 00158 } 00159 00165 public function getHelpUrl() 00166 { 00167 return $this->_helpUrl; 00168 } 00169 00176 public function setHelpUrl($value) 00177 { 00178 $this->_helpUrl = $value; 00179 return $this; 00180 } 00181 00188 public function __toString() 00189 { 00190 return $this->_text; 00191 } 00192 00193 }