|
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_MediaTitle extends Zend_Gdata_Extension 00039 { 00040 00041 protected $_rootElement = 'title'; 00042 protected $_rootNamespace = 'media'; 00043 00047 protected $_type = null; 00048 00055 public function __construct($text = null, $type = null) 00056 { 00057 $this->registerAllNamespaces(Zend_Gdata_Media::$namespaces); 00058 parent::__construct(); 00059 $this->_type = $type; 00060 $this->_text = $text; 00061 } 00062 00073 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 00074 { 00075 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 00076 if ($this->_type !== null) { 00077 $element->setAttribute('type', $this->_type); 00078 } 00079 return $element; 00080 } 00081 00089 protected function takeAttributeFromDOM($attribute) 00090 { 00091 switch ($attribute->localName) { 00092 case 'type': 00093 $this->_type = $attribute->nodeValue; 00094 break; 00095 default: 00096 parent::takeAttributeFromDOM($attribute); 00097 } 00098 } 00099 00103 public function getType() 00104 { 00105 return $this->_type; 00106 } 00107 00112 public function setType($value) 00113 { 00114 $this->_type = $value; 00115 return $this; 00116 } 00117 00118 }