|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00027 require_once 'Zend/Gdata/Entry.php'; 00028 00032 require_once 'Zend/Gdata/Spreadsheets/Extension/RowCount.php'; 00033 00037 require_once 'Zend/Gdata/Spreadsheets/Extension/ColCount.php'; 00038 00048 class Zend_Gdata_Spreadsheets_WorksheetEntry extends Zend_Gdata_Entry 00049 { 00050 00051 protected $_entryClassName = 'Zend_Gdata_Spreadsheets_WorksheetEntry'; 00052 00053 protected $_rowCount = null; 00054 protected $_colCount = null; 00055 00061 public function __construct($element = null) 00062 { 00063 $this->registerAllNamespaces(Zend_Gdata_Spreadsheets::$namespaces); 00064 parent::__construct($element); 00065 } 00066 00077 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 00078 { 00079 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 00080 if ($this->_rowCount != null) { 00081 $element->appendChild($this->_rowCount->getDOM($element->ownerDocument)); 00082 } 00083 if ($this->_colCount != null) { 00084 $element->appendChild($this->_colCount->getDOM($element->ownerDocument)); 00085 } 00086 return $element; 00087 } 00088 00095 protected function takeChildFromDOM($child) 00096 { 00097 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; 00098 switch ($absoluteNodeName) { 00099 case $this->lookupNamespace('gs') . ':' . 'rowCount'; 00100 $rowCount = new Zend_Gdata_Spreadsheets_Extension_RowCount(); 00101 $rowCount->transferFromDOM($child); 00102 $this->_rowCount = $rowCount; 00103 break; 00104 case $this->lookupNamespace('gs') . ':' . 'colCount'; 00105 $colCount = new Zend_Gdata_Spreadsheets_Extension_ColCount(); 00106 $colCount->transferFromDOM($child); 00107 $this->_colCount = $colCount; 00108 break; 00109 default: 00110 parent::takeChildFromDOM($child); 00111 break; 00112 } 00113 } 00114 00115 00121 public function getRowCount() 00122 { 00123 return $this->_rowCount; 00124 } 00125 00131 public function getColumnCount() 00132 { 00133 return $this->_colCount; 00134 } 00135 00141 public function setRowCount($rowCount) 00142 { 00143 $this->_rowCount = $rowCount; 00144 return $this; 00145 } 00146 00152 public function setColumnCount($colCount) 00153 { 00154 $this->_colCount = $colCount; 00155 return $this; 00156 } 00157 00163 public function getContentsAsRows() 00164 { 00165 $service = new Zend_Gdata_Spreadsheets($this->getHttpClient()); 00166 return $service->getSpreadsheetListFeedContents($this); 00167 } 00168 00181 public function getContentsAsCells($range = null, $empty = false) 00182 { 00183 $service = new Zend_Gdata_Spreadsheets($this->getHttpClient()); 00184 return $service->getSpreadsheetCellFeedContents($this, $range, $empty); 00185 } 00186 00187 }