|
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_MediaCredit extends Zend_Gdata_Extension 00039 { 00040 00041 protected $_rootElement = 'credit'; 00042 protected $_rootNamespace = 'media'; 00043 00047 protected $_role = null; 00048 00052 protected $_scheme = null; 00053 00061 public function __construct($text = null, $role = null, $scheme = null) 00062 { 00063 $this->registerAllNamespaces(Zend_Gdata_Media::$namespaces); 00064 parent::__construct(); 00065 $this->_text = $text; 00066 $this->_role = $role; 00067 $this->_scheme = $scheme; 00068 } 00069 00080 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 00081 { 00082 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 00083 if ($this->_role !== null) { 00084 $element->setAttribute('role', $this->_role); 00085 } 00086 if ($this->_scheme !== null) { 00087 $element->setAttribute('scheme', $this->_scheme); 00088 } 00089 return $element; 00090 } 00091 00099 protected function takeAttributeFromDOM($attribute) 00100 { 00101 switch ($attribute->localName) { 00102 case 'role': 00103 $this->_role = $attribute->nodeValue; 00104 break; 00105 case 'scheme': 00106 $this->_scheme = $attribute->nodeValue; 00107 break; 00108 default: 00109 parent::takeAttributeFromDOM($attribute); 00110 } 00111 } 00112 00116 public function getRole() 00117 { 00118 return $this->_role; 00119 } 00120 00125 public function setRole($value) 00126 { 00127 $this->_role = $value; 00128 return $this; 00129 } 00130 00134 public function getScheme() 00135 { 00136 return $this->_scheme; 00137 } 00138 00143 public function setScheme($value) 00144 { 00145 $this->_scheme = $value; 00146 return $this; 00147 } 00148 00149 }