1 | <?php
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * Zend Framework
|
---|
5 | *
|
---|
6 | * LICENSE
|
---|
7 | *
|
---|
8 | * This source file is subject to the new BSD license that is bundled
|
---|
9 | * with this package in the file LICENSE.txt.
|
---|
10 | * It is also available through the world-wide-web at this URL:
|
---|
11 | * http://framework.zend.com/license/new-bsd
|
---|
12 | * If you did not receive a copy of the license and are unable to
|
---|
13 | * obtain it through the world-wide-web, please send an email
|
---|
14 | * to license@zend.com so we can send you a copy immediately.
|
---|
15 | *
|
---|
16 | * @category Zend
|
---|
17 | * @package Zend_Gdata
|
---|
18 | * @subpackage Spreadsheets
|
---|
19 | * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
---|
20 | * @license http://framework.zend.com/license/new-bsd New BSD License
|
---|
21 | */
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * @see Zend_Gdata_Feed
|
---|
25 | */
|
---|
26 | require_once 'Zend/Gdata/Feed.php';
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * @see Zend_Gdata_Spreadsheets_Extension_RowCount
|
---|
30 | */
|
---|
31 | require_once 'Zend/Gdata/Spreadsheets/Extension/RowCount.php';
|
---|
32 |
|
---|
33 | /**
|
---|
34 | * @see Zend_Gdata_Spreadsheets_Extension_ColCount
|
---|
35 | */
|
---|
36 | require_once 'Zend/Gdata/Spreadsheets/Extension/ColCount.php';
|
---|
37 |
|
---|
38 | /**
|
---|
39 | *
|
---|
40 | * @category Zend
|
---|
41 | * @package Zend_Gdata
|
---|
42 | * @subpackage Spreadsheets
|
---|
43 | * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
---|
44 | * @license http://framework.zend.com/license/new-bsd New BSD License
|
---|
45 | */
|
---|
46 | class Zend_Gdata_Spreadsheets_CellFeed extends Zend_Gdata_Feed
|
---|
47 | {
|
---|
48 |
|
---|
49 | /**
|
---|
50 | * The classname for individual feed elements.
|
---|
51 | *
|
---|
52 | * @var string
|
---|
53 | */
|
---|
54 | protected $_entryClassName = 'Zend_Gdata_Spreadsheets_CellEntry';
|
---|
55 |
|
---|
56 | /**
|
---|
57 | * The classname for the feed.
|
---|
58 | *
|
---|
59 | * @var string
|
---|
60 | */
|
---|
61 | protected $_feedClassName = 'Zend_Gdata_Spreadsheets_CellFeed';
|
---|
62 |
|
---|
63 | /**
|
---|
64 | * The row count for the feed.
|
---|
65 | *
|
---|
66 | * @var Zend_Gdata_Spreadsheets_Extension_RowCount
|
---|
67 | */
|
---|
68 | protected $_rowCount = null;
|
---|
69 |
|
---|
70 | /**
|
---|
71 | * The column count for the feed.
|
---|
72 | *
|
---|
73 | * @var Zend_Gdata_Spreadsheets_Extension_ColCount
|
---|
74 | */
|
---|
75 | protected $_colCount = null;
|
---|
76 |
|
---|
77 | /**
|
---|
78 | * Constructs a new Zend_Gdata_Spreadsheets_CellFeed object.
|
---|
79 | * @param DOMElement $element (optional) The XML Element on which to base this object.
|
---|
80 | */
|
---|
81 | public function __construct($element = null)
|
---|
82 | {
|
---|
83 | $this->registerAllNamespaces(Zend_Gdata_Spreadsheets::$namespaces);
|
---|
84 | parent::__construct($element);
|
---|
85 | }
|
---|
86 |
|
---|
87 | public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
---|
88 | {
|
---|
89 | $element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
---|
90 | if ($this->rowCount != null) {
|
---|
91 | $element->appendChild($this->_rowCount->getDOM($element->ownerDocument));
|
---|
92 | }
|
---|
93 | if ($this->colCount != null) {
|
---|
94 | $element->appendChild($this->_colCount->getDOM($element->ownerDocument));
|
---|
95 | }
|
---|
96 | return $element;
|
---|
97 | }
|
---|
98 |
|
---|
99 | protected function takeChildFromDOM($child)
|
---|
100 | {
|
---|
101 | $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
|
---|
102 | switch ($absoluteNodeName) {
|
---|
103 | case $this->lookupNamespace('gs') . ':' . 'rowCount';
|
---|
104 | $rowCount = new Zend_Gdata_Spreadsheets_Extension_RowCount();
|
---|
105 | $rowCount->transferFromDOM($child);
|
---|
106 | $this->_rowCount = $rowCount;
|
---|
107 | break;
|
---|
108 | case $this->lookupNamespace('gs') . ':' . 'colCount';
|
---|
109 | $colCount = new Zend_Gdata_Spreadsheets_Extension_ColCount();
|
---|
110 | $colCount->transferFromDOM($child);
|
---|
111 | $this->_colCount = $colCount;
|
---|
112 | break;
|
---|
113 | default:
|
---|
114 | parent::takeChildFromDOM($child);
|
---|
115 | break;
|
---|
116 | }
|
---|
117 | }
|
---|
118 |
|
---|
119 | /**
|
---|
120 | * Gets the row count for this feed.
|
---|
121 | * @return string The row count for the feed.
|
---|
122 | */
|
---|
123 | public function getRowCount()
|
---|
124 | {
|
---|
125 | return $this->_rowCount;
|
---|
126 | }
|
---|
127 |
|
---|
128 | /**
|
---|
129 | * Gets the column count for this feed.
|
---|
130 | * @return string The column count for the feed.
|
---|
131 | */
|
---|
132 | public function getColumnCount()
|
---|
133 | {
|
---|
134 | return $this->_colCount;
|
---|
135 | }
|
---|
136 |
|
---|
137 | /**
|
---|
138 | * Sets the row count for this feed.
|
---|
139 | * @param string $rowCount The new row count for the feed.
|
---|
140 | */
|
---|
141 | public function setRowCount($rowCount)
|
---|
142 | {
|
---|
143 | $this->_rowCount = $rowCount;
|
---|
144 | return $this;
|
---|
145 | }
|
---|
146 |
|
---|
147 | /**
|
---|
148 | * Sets the column count for this feed.
|
---|
149 | * @param string $colCount The new column count for the feed.
|
---|
150 | */
|
---|
151 | public function setColumnCount($colCount)
|
---|
152 | {
|
---|
153 | $this->_colCount = $colCount;
|
---|
154 | return $this;
|
---|
155 | }
|
---|
156 |
|
---|
157 | }
|
---|