]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - Zend/Gdata/Spreadsheets/CellFeed.php
Release 6.5.0
[Github/sugarcrm.git] / Zend / Gdata / Spreadsheets / CellFeed.php
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-2010 Zend Technologies USA Inc. (http://www.zend.com)
20  * @license    http://framework.zend.com/license/new-bsd     New BSD License
21
22  */
23
24 /**
25  * @see Zend_Gdata_Feed
26  */
27 require_once 'Zend/Gdata/Feed.php';
28
29 /**
30  * @see Zend_Gdata_Spreadsheets_Extension_RowCount
31  */
32 require_once 'Zend/Gdata/Spreadsheets/Extension/RowCount.php';
33
34 /**
35  * @see Zend_Gdata_Spreadsheets_Extension_ColCount
36  */
37 require_once 'Zend/Gdata/Spreadsheets/Extension/ColCount.php';
38
39 /**
40  *
41  * @category   Zend
42  * @package    Zend_Gdata
43  * @subpackage   Spreadsheets
44  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
45  * @license    http://framework.zend.com/license/new-bsd     New BSD License
46  */
47 class Zend_Gdata_Spreadsheets_CellFeed extends Zend_Gdata_Feed
48 {
49
50     /**
51     * The classname for individual feed elements.
52     *
53     * @var string
54     */
55     protected $_entryClassName = 'Zend_Gdata_Spreadsheets_CellEntry';
56
57     /**
58     * The classname for the feed.
59     *
60     * @var string
61     */
62     protected $_feedClassName = 'Zend_Gdata_Spreadsheets_CellFeed';
63
64     /**
65     * The row count for the feed.
66     *
67     * @var Zend_Gdata_Spreadsheets_Extension_RowCount
68     */
69     protected $_rowCount = null;
70
71     /**
72     * The column count for the feed.
73     *
74     * @var Zend_Gdata_Spreadsheets_Extension_ColCount
75     */
76     protected $_colCount = null;
77
78     /**
79      * Constructs a new Zend_Gdata_Spreadsheets_CellFeed object.
80      * @param DOMElement $element (optional) The XML Element on which to base this object.
81      */
82     public function __construct($element = null)
83     {
84         $this->registerAllNamespaces(Zend_Gdata_Spreadsheets::$namespaces);
85         parent::__construct($element);
86     }
87
88     public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
89     {
90         $element = parent::getDOM($doc, $majorVersion, $minorVersion);
91         if ($this->rowCount != null) {
92             $element->appendChild($this->_rowCount->getDOM($element->ownerDocument));
93         }
94         if ($this->colCount != null) {
95             $element->appendChild($this->_colCount->getDOM($element->ownerDocument));
96         }
97         return $element;
98     }
99
100     protected function takeChildFromDOM($child)
101     {
102         $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
103         switch ($absoluteNodeName) {
104             case $this->lookupNamespace('gs') . ':' . 'rowCount';
105                 $rowCount = new Zend_Gdata_Spreadsheets_Extension_RowCount();
106                 $rowCount->transferFromDOM($child);
107                 $this->_rowCount = $rowCount;
108                 break;
109             case $this->lookupNamespace('gs') . ':' . 'colCount';
110                 $colCount = new Zend_Gdata_Spreadsheets_Extension_ColCount();
111                 $colCount->transferFromDOM($child);
112                 $this->_colCount = $colCount;
113                 break;
114             default:
115                 parent::takeChildFromDOM($child);
116                 break;
117         }
118     }
119
120     /**
121      * Gets the row count for this feed.
122      * @return string The row count for the feed.
123      */
124     public function getRowCount()
125     {
126         return $this->_rowCount;
127     }
128
129     /**
130      * Gets the column count for this feed.
131      * @return string The column count for the feed.
132      */
133     public function getColumnCount()
134     {
135         return $this->_colCount;
136     }
137
138     /**
139      * Sets the row count for this feed.
140      * @param string $rowCount The new row count for the feed.
141      */
142     public function setRowCount($rowCount)
143     {
144         $this->_rowCount = $rowCount;
145         return $this;
146     }
147
148     /**
149      * Sets the column count for this feed.
150      * @param string $colCount The new column count for the feed.
151      */
152     public function setColumnCount($colCount)
153     {
154         $this->_colCount = $colCount;
155         return $this;
156     }
157
158 }