|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00027 require_once 'Zend/Gdata/Extension.php'; 00028 00032 require_once 'Zend/Gdata/Geo.php'; 00033 00037 require_once 'Zend/Gdata/Geo/Extension/GmlPoint.php'; 00038 00039 00049 class Zend_Gdata_Geo_Extension_GeoRssWhere extends Zend_Gdata_Extension 00050 { 00051 00052 protected $_rootNamespace = 'georss'; 00053 protected $_rootElement = 'where'; 00054 00060 protected $_point = null; 00061 00068 public function __construct($point = null) 00069 { 00070 $this->registerAllNamespaces(Zend_Gdata_Geo::$namespaces); 00071 parent::__construct(); 00072 $this->setPoint($point); 00073 } 00074 00084 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 00085 { 00086 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 00087 if ($this->_point !== null) { 00088 $element->appendChild($this->_point->getDOM($element->ownerDocument)); 00089 } 00090 return $element; 00091 } 00092 00099 protected function takeChildFromDOM($child) 00100 { 00101 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; 00102 00103 switch ($absoluteNodeName) { 00104 case $this->lookupNamespace('gml') . ':' . 'Point'; 00105 $point = new Zend_Gdata_Geo_Extension_GmlPoint(); 00106 $point->transferFromDOM($child); 00107 $this->_point = $point; 00108 break; 00109 } 00110 } 00111 00118 public function getPoint() 00119 { 00120 return $this->_point; 00121 } 00122 00129 public function setPoint($value) 00130 { 00131 $this->_point = $value; 00132 return $this; 00133 } 00134 00135 }