File indexing completed on 2024-12-22 05:36:46
0001 <?php 0002 0003 /** 0004 * Zend Framework 0005 * 0006 * LICENSE 0007 * 0008 * This source file is subject to the new BSD license that is bundled 0009 * with this package in the file LICENSE.txt. 0010 * It is also available through the world-wide-web at this URL: 0011 * http://framework.zend.com/license/new-bsd 0012 * If you did not receive a copy of the license and are unable to 0013 * obtain it through the world-wide-web, please send an email 0014 * to license@zend.com so we can send you a copy immediately. 0015 * 0016 * @category Zend 0017 * @package Zend_Gdata 0018 * @subpackage Spreadsheets 0019 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0020 * @license http://framework.zend.com/license/new-bsd New BSD License 0021 * @version $Id$ 0022 */ 0023 0024 /** 0025 * @see Zend_Gdata_Feed 0026 */ 0027 // require_once 'Zend/Gdata/Feed.php'; 0028 0029 /** 0030 * @see Zend_Gdata_Spreadsheets_Extension_RowCount 0031 */ 0032 // require_once 'Zend/Gdata/Spreadsheets/Extension/RowCount.php'; 0033 0034 /** 0035 * @see Zend_Gdata_Spreadsheets_Extension_ColCount 0036 */ 0037 // require_once 'Zend/Gdata/Spreadsheets/Extension/ColCount.php'; 0038 0039 /** 0040 * 0041 * @category Zend 0042 * @package Zend_Gdata 0043 * @subpackage Spreadsheets 0044 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0045 * @license http://framework.zend.com/license/new-bsd New BSD License 0046 */ 0047 class Zend_Gdata_Spreadsheets_CellFeed extends Zend_Gdata_Feed 0048 { 0049 0050 /** 0051 * The classname for individual feed elements. 0052 * 0053 * @var string 0054 */ 0055 protected $_entryClassName = 'Zend_Gdata_Spreadsheets_CellEntry'; 0056 0057 /** 0058 * The classname for the feed. 0059 * 0060 * @var string 0061 */ 0062 protected $_feedClassName = 'Zend_Gdata_Spreadsheets_CellFeed'; 0063 0064 /** 0065 * The row count for the feed. 0066 * 0067 * @var Zend_Gdata_Spreadsheets_Extension_RowCount 0068 */ 0069 protected $_rowCount = null; 0070 0071 /** 0072 * The column count for the feed. 0073 * 0074 * @var Zend_Gdata_Spreadsheets_Extension_ColCount 0075 */ 0076 protected $_colCount = null; 0077 0078 /** 0079 * Constructs a new Zend_Gdata_Spreadsheets_CellFeed object. 0080 * @param DOMElement $element (optional) The XML Element on which to base this object. 0081 */ 0082 public function __construct($element = null) 0083 { 0084 $this->registerAllNamespaces(Zend_Gdata_Spreadsheets::$namespaces); 0085 parent::__construct($element); 0086 } 0087 0088 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 0089 { 0090 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 0091 if ($this->rowCount != null) { 0092 $element->appendChild($this->_rowCount->getDOM($element->ownerDocument)); 0093 } 0094 if ($this->colCount != null) { 0095 $element->appendChild($this->_colCount->getDOM($element->ownerDocument)); 0096 } 0097 return $element; 0098 } 0099 0100 protected function takeChildFromDOM($child) 0101 { 0102 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; 0103 switch ($absoluteNodeName) { 0104 case $this->lookupNamespace('gs') . ':' . 'rowCount'; 0105 $rowCount = new Zend_Gdata_Spreadsheets_Extension_RowCount(); 0106 $rowCount->transferFromDOM($child); 0107 $this->_rowCount = $rowCount; 0108 break; 0109 case $this->lookupNamespace('gs') . ':' . 'colCount'; 0110 $colCount = new Zend_Gdata_Spreadsheets_Extension_ColCount(); 0111 $colCount->transferFromDOM($child); 0112 $this->_colCount = $colCount; 0113 break; 0114 default: 0115 parent::takeChildFromDOM($child); 0116 break; 0117 } 0118 } 0119 0120 /** 0121 * Gets the row count for this feed. 0122 * @return string The row count for the feed. 0123 */ 0124 public function getRowCount() 0125 { 0126 return $this->_rowCount; 0127 } 0128 0129 /** 0130 * Gets the column count for this feed. 0131 * @return string The column count for the feed. 0132 */ 0133 public function getColumnCount() 0134 { 0135 return $this->_colCount; 0136 } 0137 0138 /** 0139 * Sets the row count for this feed. 0140 * @param string $rowCount The new row count for the feed. 0141 */ 0142 public function setRowCount($rowCount) 0143 { 0144 $this->_rowCount = $rowCount; 0145 return $this; 0146 } 0147 0148 /** 0149 * Sets the column count for this feed. 0150 * @param string $colCount The new column count for the feed. 0151 */ 0152 public function setColumnCount($colCount) 0153 { 0154 $this->_colCount = $colCount; 0155 return $this; 0156 } 0157 0158 }