]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - Zend/Gdata/Calendar/ListEntry.php
Release 6.5.0
[Github/sugarcrm.git] / Zend / Gdata / Calendar / ListEntry.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 Calendar
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_Entry
26  */
27 require_once 'Zend/Gdata/Entry.php';
28
29 /**
30  * @see Zend_Calendar_Extension_AccessLevel
31  */
32 require_once 'Zend/Gdata/Calendar/Extension/AccessLevel.php';
33
34 /**
35  * @see Zend_Calendar_Extension_Color
36  */
37 require_once 'Zend/Gdata/Calendar/Extension/Color.php';
38
39 /**
40  * @see Zend_Calendar_Extension_Hidden
41  */
42 require_once 'Zend/Gdata/Calendar/Extension/Hidden.php';
43
44 /**
45  * @see Zend_Calendar_Extension_Selected
46  */
47 require_once 'Zend/Gdata/Calendar/Extension/Selected.php';
48
49 /**
50  * @see Zend_Gdata_Extension_EventStatus
51  */
52 require_once 'Zend/Gdata/Extension/EventStatus.php';
53
54 /**
55  * @see Zend_Gdata_Extension_Visibility
56  */
57 require_once 'Zend/Gdata/Extension/Visibility.php';
58
59
60 /**
61  * @see Zend_Extension_Where
62  */
63 require_once 'Zend/Gdata/Extension/Where.php';
64
65 /**
66  * Represents a Calendar entry in the Calendar data API meta feed of a user's
67  * calendars.
68  *
69  * @category   Zend
70  * @package    Zend_Gdata
71  * @subpackage Calendar
72  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
73  * @license    http://framework.zend.com/license/new-bsd     New BSD License
74  */
75 class Zend_Gdata_Calendar_ListEntry extends Zend_Gdata_Entry
76 {
77
78     protected $_color = null;
79     protected $_accessLevel = null;
80     protected $_hidden = null;
81     protected $_selected = null;
82     protected $_timezone = null;
83     protected $_where = array();
84
85     public function __construct($element = null)
86     {
87         $this->registerAllNamespaces(Zend_Gdata_Calendar::$namespaces);
88         parent::__construct($element);
89     }
90
91     public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
92     {
93         $element = parent::getDOM($doc, $majorVersion, $minorVersion);
94         if ($this->_accessLevel != null) {
95             $element->appendChild($this->_accessLevel->getDOM($element->ownerDocument));
96         }
97         if ($this->_color != null) {
98             $element->appendChild($this->_color->getDOM($element->ownerDocument));
99         }
100         if ($this->_hidden != null) {
101             $element->appendChild($this->_hidden->getDOM($element->ownerDocument));
102         }
103         if ($this->_selected != null) {
104             $element->appendChild($this->_selected->getDOM($element->ownerDocument));
105         }
106         if ($this->_timezone != null) {
107             $element->appendChild($this->_timezone->getDOM($element->ownerDocument));
108         }
109         if ($this->_where != null) {
110             foreach ($this->_where as $where) {
111                 $element->appendChild($where->getDOM($element->ownerDocument));
112             }
113         }
114         return $element;
115     }
116
117     protected function takeChildFromDOM($child)
118     {
119         $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
120         switch ($absoluteNodeName) {
121         case $this->lookupNamespace('gCal') . ':' . 'accesslevel';
122             $accessLevel = new Zend_Gdata_Calendar_Extension_AccessLevel();
123             $accessLevel->transferFromDOM($child);
124             $this->_accessLevel = $accessLevel;
125             break;
126         case $this->lookupNamespace('gCal') . ':' . 'color';
127             $color = new Zend_Gdata_Calendar_Extension_Color();
128             $color->transferFromDOM($child);
129             $this->_color = $color;
130             break;
131         case $this->lookupNamespace('gCal') . ':' . 'hidden';
132             $hidden = new Zend_Gdata_Calendar_Extension_Hidden();
133             $hidden->transferFromDOM($child);
134             $this->_hidden = $hidden;
135             break;
136         case $this->lookupNamespace('gCal') . ':' . 'selected';
137             $selected = new Zend_Gdata_Calendar_Extension_Selected();
138             $selected->transferFromDOM($child);
139             $this->_selected = $selected;
140             break;
141         case $this->lookupNamespace('gCal') . ':' . 'timezone';
142             $timezone = new Zend_Gdata_Calendar_Extension_Timezone();
143             $timezone->transferFromDOM($child);
144             $this->_timezone = $timezone;
145             break;
146         case $this->lookupNamespace('gd') . ':' . 'where';
147             $where = new Zend_Gdata_Extension_Where();
148             $where->transferFromDOM($child);
149             $this->_where[] = $where;
150             break;
151         default:
152             parent::takeChildFromDOM($child);
153             break;
154         }
155     }
156
157     public function getAccessLevel()
158     {
159         return $this->_accessLevel;
160     }
161
162     /**
163      * @param Zend_Gdata_Calendar_Extension_AccessLevel $value
164      * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
165      */
166     public function setAccessLevel($value)
167     {
168         $this->_accessLevel = $value;
169         return $this;
170     }
171     public function getColor()
172     {
173         return $this->_color;
174     }
175
176     /**
177      * @param Zend_Gdata_Calendar_Extension_Color $value
178      * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
179      */
180     public function setColor($value)
181     {
182         $this->_color = $value;
183         return $this;
184     }
185
186     public function getHidden()
187     {
188         return $this->_hidden;
189     }
190
191     /**
192      * @param Zend_Gdata_Calendar_Extension_Hidden $value
193      * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
194      */
195     public function setHidden($value)
196     {
197         $this->_hidden = $value;
198         return $this;
199     }
200
201     public function getSelected()
202     {
203         return $this->_selected;
204     }
205
206     /**
207      * @param Zend_Gdata_Calendar_Extension_Selected $value
208      * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
209      */
210     public function setSelected($value)
211     {
212         $this->_selected = $value;
213         return $this;
214     }
215
216     public function getTimezone()
217     {
218         return $this->_timezone;
219     }
220
221     /**
222      * @param Zend_Gdata_Calendar_Extension_Timezone $value
223      * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
224      */
225     public function setTimezone($value)
226     {
227         $this->_timezone = $value;
228         return $this;
229     }
230
231     public function getWhere()
232     {
233         return $this->_where;
234     }
235
236     /**
237      * @param Zend_Gdata_Extension_Where $value
238      * @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
239      */
240     public function setWhere($value)
241     {
242         $this->_where = $value;
243         return $this;
244     }
245
246 }