|
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_MediaHash extends Zend_Gdata_Extension 00039 { 00040 00041 protected $_rootElement = 'hash'; 00042 protected $_rootNamespace = 'media'; 00043 protected $_algo = null; 00044 00051 public function __construct($text = null, $algo = null) 00052 { 00053 $this->registerAllNamespaces(Zend_Gdata_Media::$namespaces); 00054 parent::__construct(); 00055 $this->_text = $text; 00056 $this->_algo = $algo; 00057 } 00058 00069 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 00070 { 00071 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 00072 if ($this->_algo !== null) { 00073 $element->setAttribute('algo', $this->_algo); 00074 } 00075 return $element; 00076 } 00077 00086 protected function takeAttributeFromDOM($attribute) 00087 { 00088 switch ($attribute->localName) { 00089 case 'algo': 00090 $this->_algo = $attribute->nodeValue; 00091 break; 00092 default: 00093 parent::takeAttributeFromDOM($attribute); 00094 } 00095 } 00096 00100 public function getAlgo() 00101 { 00102 return $this->_algo; 00103 } 00104 00109 public function setAlgo($value) 00110 { 00111 $this->_algo = $value; 00112 return $this; 00113 } 00114 00115 }