|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00027 require_once 'Zend/Gdata/Extension.php'; 00028 00032 require_once 'Zend/Gdata/Feed.php'; 00033 00037 require_once 'Zend/Gdata/Extension/When.php'; 00038 00048 class Zend_Gdata_Extension_OriginalEvent extends Zend_Gdata_Extension 00049 { 00050 00051 protected $_rootElement = 'originalEvent'; 00052 protected $_id = null; 00053 protected $_href = null; 00054 protected $_when = null; 00055 00056 public function __construct($id = null, $href = null, $when = null) 00057 { 00058 parent::__construct(); 00059 $this->_id = $id; 00060 $this->_href = $href; 00061 $this->_when = $when; 00062 } 00063 00064 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 00065 { 00066 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 00067 if ($this->_id !== null) { 00068 $element->setAttribute('id', $this->_id); 00069 } 00070 if ($this->_href !== null) { 00071 $element->setAttribute('href', $this->_href); 00072 } 00073 if ($this->_when !== null) { 00074 $element->appendChild($this->_when->getDOM($element->ownerDocument)); 00075 } 00076 return $element; 00077 } 00078 00079 protected function takeAttributeFromDOM($attribute) 00080 { 00081 switch ($attribute->localName) { 00082 case 'id': 00083 $this->_id = $attribute->nodeValue; 00084 break; 00085 case 'href': 00086 $this->_href = $attribute->nodeValue; 00087 break; 00088 default: 00089 parent::takeAttributeFromDOM($attribute); 00090 } 00091 } 00092 00093 protected function takeChildFromDOM($child) 00094 { 00095 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; 00096 switch ($absoluteNodeName) { 00097 case $this->lookupNamespace('gd') . ':' . 'when'; 00098 $when = new Zend_Gdata_Extension_When(); 00099 $when->transferFromDOM($child); 00100 $this->_when = $when; 00101 break; 00102 default: 00103 parent::takeChildFromDOM($child); 00104 break; 00105 } 00106 } 00107 00108 public function getId() 00109 { 00110 return $this->_id; 00111 } 00112 00113 public function setId($value) 00114 { 00115 $this->_id = $value; 00116 return $this; 00117 } 00118 00119 public function getHref() 00120 { 00121 return $this->_href; 00122 } 00123 00124 public function setHref($value) 00125 { 00126 $this->_href = $value; 00127 return $this; 00128 } 00129 00130 public function getWhen() 00131 { 00132 return $this->_when; 00133 } 00134 00135 public function setWhen($value) 00136 { 00137 $this->_when = $value; 00138 return $this; 00139 } 00140 00141 00142 }