|
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_Racy extends Zend_Gdata_Extension 00039 { 00040 00041 protected $_rootNamespace = 'yt'; 00042 protected $_rootElement = 'racy'; 00043 protected $_state = null; 00044 00049 public function __construct($state = null) 00050 { 00051 $this->registerAllNamespaces(Zend_Gdata_YouTube::$namespaces); 00052 parent::__construct(); 00053 $this->_state = $state; 00054 } 00055 00066 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 00067 { 00068 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 00069 if ($this->_state !== null) { 00070 $element->setAttribute('state', $this->_state); 00071 } 00072 return $element; 00073 } 00074 00082 protected function takeAttributeFromDOM($attribute) 00083 { 00084 switch ($attribute->localName) { 00085 case 'state': 00086 $this->_state = $attribute->nodeValue; 00087 break; 00088 default: 00089 parent::takeAttributeFromDOM($attribute); 00090 } 00091 } 00092 00098 public function getState() 00099 { 00100 return $this->_state; 00101 } 00102 00109 public function setState($value) 00110 { 00111 $this->_state = $value; 00112 return $this; 00113 } 00114 00119 public function __toString() 00120 { 00121 return $this->_state; 00122 } 00123 00124 }