|
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_MediaText extends Zend_Gdata_Extension 00039 { 00040 00041 protected $_rootElement = 'text'; 00042 protected $_rootNamespace = 'media'; 00043 00047 protected $_type = null; 00048 00052 protected $_lang = null; 00053 00057 protected $_start = null; 00058 00062 protected $_end = null; 00063 00073 public function __construct($text = null, $type = null, $lang = null, 00074 $start = null, $end = null) 00075 { 00076 $this->registerAllNamespaces(Zend_Gdata_Media::$namespaces); 00077 parent::__construct(); 00078 $this->_text = $text; 00079 $this->_type = $type; 00080 $this->_lang = $lang; 00081 $this->_start = $start; 00082 $this->_end = $end; 00083 } 00084 00095 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 00096 { 00097 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 00098 if ($this->_type !== null) { 00099 $element->setAttribute('type', $this->_type); 00100 } 00101 if ($this->_lang !== null) { 00102 $element->setAttribute('lang', $this->_lang); 00103 } 00104 if ($this->_start !== null) { 00105 $element->setAttribute('start', $this->_start); 00106 } 00107 if ($this->_end !== null) { 00108 $element->setAttribute('end', $this->_end); 00109 } 00110 return $element; 00111 } 00112 00120 protected function takeAttributeFromDOM($attribute) 00121 { 00122 switch ($attribute->localName) { 00123 case 'type': 00124 $this->_type = $attribute->nodeValue; 00125 break; 00126 case 'lang': 00127 $this->_lang = $attribute->nodeValue; 00128 break; 00129 case 'start': 00130 $this->_start = $attribute->nodeValue; 00131 break; 00132 case 'end': 00133 $this->_end = $attribute->nodeValue; 00134 break; 00135 default: 00136 parent::takeAttributeFromDOM($attribute); 00137 } 00138 } 00139 00143 public function getType() 00144 { 00145 return $this->_type; 00146 } 00147 00152 public function setType($value) 00153 { 00154 $this->_type = $value; 00155 return $this; 00156 } 00157 00161 public function getLang() 00162 { 00163 return $this->_lang; 00164 } 00165 00170 public function setLang($value) 00171 { 00172 $this->_lang = $value; 00173 return $this; 00174 } 00175 00179 public function getStart() 00180 { 00181 return $this->_start; 00182 } 00183 00188 public function setStart($value) 00189 { 00190 $this->_start = $value; 00191 return $this; 00192 } 00193 00197 public function getEnd() 00198 { 00199 return $this->_end; 00200 } 00201 00206 public function setEnd($value) 00207 { 00208 $this->_end = $value; 00209 return $this; 00210 } 00211 }