File indexing completed on 2025-03-02 05:29:29
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_Entry 0026 */ 0027 // require_once 'Zend/Gdata/Entry.php'; 0028 0029 /** 0030 * @see Zend_Gdata_Spreadsheets_Extension_Cell 0031 */ 0032 // require_once 'Zend/Gdata/Spreadsheets/Extension/Cell.php'; 0033 0034 /** 0035 * Concrete class for working with Cell entries. 0036 * 0037 * @category Zend 0038 * @package Zend_Gdata 0039 * @subpackage Spreadsheets 0040 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0041 * @license http://framework.zend.com/license/new-bsd New BSD License 0042 */ 0043 class Zend_Gdata_Spreadsheets_CellEntry extends Zend_Gdata_Entry 0044 { 0045 0046 protected $_entryClassName = 'Zend_Gdata_Spreadsheets_CellEntry'; 0047 protected $_cell; 0048 0049 /** 0050 * Constructs a new Zend_Gdata_Spreadsheets_CellEntry object. 0051 * @param string $uri (optional) 0052 * @param DOMElement $element (optional) The DOMElement on which to base this object. 0053 */ 0054 public function __construct($element = null) 0055 { 0056 $this->registerAllNamespaces(Zend_Gdata_Spreadsheets::$namespaces); 0057 parent::__construct($element); 0058 } 0059 0060 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null) 0061 { 0062 $element = parent::getDOM($doc, $majorVersion, $minorVersion); 0063 if ($this->_cell != null) { 0064 $element->appendChild($this->_cell->getDOM($element->ownerDocument)); 0065 } 0066 return $element; 0067 } 0068 0069 protected function takeChildFromDOM($child) 0070 { 0071 $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; 0072 switch ($absoluteNodeName) { 0073 case $this->lookupNamespace('gs') . ':' . 'cell'; 0074 $cell = new Zend_Gdata_Spreadsheets_Extension_Cell(); 0075 $cell->transferFromDOM($child); 0076 $this->_cell = $cell; 0077 break; 0078 default: 0079 parent::takeChildFromDOM($child); 0080 break; 0081 } 0082 } 0083 0084 /** 0085 * Gets the Cell element of this Cell Entry. 0086 * @return Zend_Gdata_Spreadsheets_Extension_Cell 0087 */ 0088 public function getCell() 0089 { 0090 return $this->_cell; 0091 } 0092 0093 /** 0094 * Sets the Cell element of this Cell Entry. 0095 * @param Zend_Gdata_Spreadsheets_Extension_Cell $cell 0096 * @return Zend_Gdata_Spreadsheets_CellEntry 0097 */ 0098 public function setCell($cell) 0099 { 0100 $this->_cell = $cell; 0101 return $this; 0102 } 0103 0104 }