|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00027 require_once 'Zend/Gdata/Entry.php'; 00028 00032 require_once 'Zend/Gdata/Photos/Extension/Weight.php'; 00033 00037 require_once 'Zend/Gdata/App/Extension/Category.php'; 00038 00054 class Zend_Gdata_Photos_TagEntry extends Zend_Gdata_Entry 00055 { 00056 00057 protected $_entryClassName = 'Zend_Gdata_Photos_TagEntry'; 00058 00059 protected $_gphotoWeight = null; 00060 00067 public function __construct($element = null) 00068 { 00069 $this->registerAllNamespaces(Zend_Gdata_Photos::$namespaces); 00070 parent::__construct($element); 00071 00072 $category = new Zend_Gdata_App_Extension_Category( 00073 'http://schemas.google.com/photos/2007#tag', 00074 'http://schemas.google.com/g/2005#kind'); 00075 $this->setCategory(array($category)); 00076 } 00077 00087 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 00088 { 00089 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 00090 if ($this->_gphotoWeight !== null) { 00091 $element->appendChild($this->_gphotoWeight->getDOM($element->ownerDocument)); 00092 } 00093 return $element; 00094 } 00095 00102 protected function takeChildFromDOM($child) 00103 { 00104 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; 00105 00106 switch ($absoluteNodeName) { 00107 case $this->lookupNamespace('gphoto') . ':' . 'weight'; 00108 $weight = new Zend_Gdata_Photos_Extension_Weight(); 00109 $weight->transferFromDOM($child); 00110 $this->_gphotoWeight = $weight; 00111 break; 00112 default: 00113 parent::takeChildFromDOM($child); 00114 break; 00115 } 00116 } 00117 00124 public function getGphotoWeight() 00125 { 00126 return $this->_gphotoWeight; 00127 } 00128 00135 public function setGphotoWeight($value) 00136 { 00137 $this->_gphotoWeight = $value; 00138 return $this; 00139 } 00140 }