1 | <?php
|
---|
2 | /**
|
---|
3 | * Zend Framework
|
---|
4 | *
|
---|
5 | * LICENSE
|
---|
6 | *
|
---|
7 | * This source file is subject to the new BSD license that is bundled
|
---|
8 | * with this package in the file LICENSE.txt.
|
---|
9 | * It is also available through the world-wide-web at this URL:
|
---|
10 | * http://framework.zend.com/license/new-bsd
|
---|
11 | * If you did not receive a copy of the license and are unable to
|
---|
12 | * obtain it through the world-wide-web, please send an email
|
---|
13 | * to license@zend.com so we can send you a copy immediately.
|
---|
14 | *
|
---|
15 | * @category Zend
|
---|
16 | * @package Zend_Gdata
|
---|
17 | * @subpackage Gdata
|
---|
18 | * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
---|
19 | * @license http://framework.zend.com/license/new-bsd New BSD License
|
---|
20 | */
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * @see Zend_Gdata_Entry
|
---|
24 | */
|
---|
25 | require_once 'Zend/Gdata/Entry.php';
|
---|
26 |
|
---|
27 | /**
|
---|
28 | * @see Zend_Gdata_App_Extension
|
---|
29 | */
|
---|
30 | require_once 'Zend/Gdata/App/Extension.php';
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * @see Zend_Gdata_Extension_Where
|
---|
34 | */
|
---|
35 | require_once 'Zend/Gdata/Extension/Where.php';
|
---|
36 |
|
---|
37 | /**
|
---|
38 | * @see Zend_Gdata_Extension_When
|
---|
39 | */
|
---|
40 | require_once 'Zend/Gdata/Extension/When.php';
|
---|
41 |
|
---|
42 | /**
|
---|
43 | * @see Zend_Gdata_Extension_Who
|
---|
44 | */
|
---|
45 | require_once 'Zend/Gdata/Extension/Who.php';
|
---|
46 |
|
---|
47 | /**
|
---|
48 | * @see Zend_Gdata_Extension_Recurrence
|
---|
49 | */
|
---|
50 | require_once 'Zend/Gdata/Extension/Recurrence.php';
|
---|
51 |
|
---|
52 | /**
|
---|
53 | * @see Zend_Gdata_Extension_EventStatus
|
---|
54 | */
|
---|
55 | require_once 'Zend/Gdata/Extension/EventStatus.php';
|
---|
56 |
|
---|
57 | /**
|
---|
58 | * @see Zend_Gdata_Extension_Comments
|
---|
59 | */
|
---|
60 | require_once 'Zend/Gdata/Extension/Comments.php';
|
---|
61 |
|
---|
62 | /**
|
---|
63 | * @see Zend_Gdata_Extension_Transparency
|
---|
64 | */
|
---|
65 | require_once 'Zend/Gdata/Extension/Transparency.php';
|
---|
66 |
|
---|
67 | /**
|
---|
68 | * @see Zend_Gdata_Extension_Visibility
|
---|
69 | */
|
---|
70 | require_once 'Zend/Gdata/Extension/Visibility.php';
|
---|
71 |
|
---|
72 | /**
|
---|
73 | * @see Zend_Gdata_Extension_ExtendedProperty
|
---|
74 | */
|
---|
75 | require_once 'Zend/Gdata/Extension/ExtendedProperty.php';
|
---|
76 |
|
---|
77 | /**
|
---|
78 | * @see Zend_Gdata_Extension_OriginalEvent
|
---|
79 | */
|
---|
80 | require_once 'Zend/Gdata/Extension/OriginalEvent.php';
|
---|
81 |
|
---|
82 | /**
|
---|
83 | * @see Zend_Gdata_Extension_EntryLink
|
---|
84 | */
|
---|
85 | require_once 'Zend/Gdata/Extension/EntryLink.php';
|
---|
86 |
|
---|
87 | /**
|
---|
88 | * Data model for the Gdata Event "Kind". Google Calendar has a separate
|
---|
89 | * EventEntry class which extends this.
|
---|
90 | *
|
---|
91 | * @category Zend
|
---|
92 | * @package Zend_Gdata
|
---|
93 | * @subpackage Gdata
|
---|
94 | * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
---|
95 | * @license http://framework.zend.com/license/new-bsd New BSD License
|
---|
96 | */
|
---|
97 | class Zend_Gdata_Kind_EventEntry extends Zend_Gdata_Entry
|
---|
98 | {
|
---|
99 | protected $_who = array();
|
---|
100 | protected $_when = array();
|
---|
101 | protected $_where = array();
|
---|
102 | protected $_recurrence = null;
|
---|
103 | protected $_eventStatus = null;
|
---|
104 | protected $_comments = null;
|
---|
105 | protected $_transparency = null;
|
---|
106 | protected $_visibility = null;
|
---|
107 | protected $_recurrenceException = array();
|
---|
108 | protected $_extendedProperty = array();
|
---|
109 | protected $_originalEvent = null;
|
---|
110 | protected $_entryLink = null;
|
---|
111 |
|
---|
112 | public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
|
---|
113 | {
|
---|
114 | $element = parent::getDOM($doc, $majorVersion, $minorVersion);
|
---|
115 | if ($this->_who != null) {
|
---|
116 | foreach ($this->_who as $who) {
|
---|
117 | $element->appendChild($who->getDOM($element->ownerDocument));
|
---|
118 | }
|
---|
119 | }
|
---|
120 | if ($this->_when != null) {
|
---|
121 | foreach ($this->_when as $when) {
|
---|
122 | $element->appendChild($when->getDOM($element->ownerDocument));
|
---|
123 | }
|
---|
124 | }
|
---|
125 | if ($this->_where != null) {
|
---|
126 | foreach ($this->_where as $where) {
|
---|
127 | $element->appendChild($where->getDOM($element->ownerDocument));
|
---|
128 | }
|
---|
129 | }
|
---|
130 | if ($this->_recurrenceException != null) {
|
---|
131 | foreach ($this->_recurrenceException as $recurrenceException) {
|
---|
132 | $element->appendChild($recurrenceException->getDOM($element->ownerDocument));
|
---|
133 | }
|
---|
134 | }
|
---|
135 | if ($this->_extendedProperty != null) {
|
---|
136 | foreach ($this->_extendedProperty as $extProp) {
|
---|
137 | $element->appendChild($extProp->getDOM($element->ownerDocument));
|
---|
138 | }
|
---|
139 | }
|
---|
140 |
|
---|
141 | if ($this->_recurrence != null) {
|
---|
142 | $element->appendChild($this->_recurrence->getDOM($element->ownerDocument));
|
---|
143 | }
|
---|
144 | if ($this->_eventStatus != null) {
|
---|
145 | $element->appendChild($this->_eventStatus->getDOM($element->ownerDocument));
|
---|
146 | }
|
---|
147 | if ($this->_comments != null) {
|
---|
148 | $element->appendChild($this->_comments->getDOM($element->ownerDocument));
|
---|
149 | }
|
---|
150 | if ($this->_transparency != null) {
|
---|
151 | $element->appendChild($this->_transparency->getDOM($element->ownerDocument));
|
---|
152 | }
|
---|
153 | if ($this->_visibility != null) {
|
---|
154 | $element->appendChild($this->_visibility->getDOM($element->ownerDocument));
|
---|
155 | }
|
---|
156 | if ($this->_originalEvent != null) {
|
---|
157 | $element->appendChild($this->_originalEvent->getDOM($element->ownerDocument));
|
---|
158 | }
|
---|
159 | if ($this->_entryLink != null) {
|
---|
160 | $element->appendChild($this->_entryLink->getDOM($element->ownerDocument));
|
---|
161 | }
|
---|
162 |
|
---|
163 |
|
---|
164 | return $element;
|
---|
165 | }
|
---|
166 |
|
---|
167 | protected function takeChildFromDOM($child)
|
---|
168 | {
|
---|
169 | $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
|
---|
170 | switch ($absoluteNodeName) {
|
---|
171 | case $this->lookupNamespace('gd') . ':' . 'where';
|
---|
172 | $where = new Zend_Gdata_Extension_Where();
|
---|
173 | $where->transferFromDOM($child);
|
---|
174 | $this->_where[] = $where;
|
---|
175 | break;
|
---|
176 | case $this->lookupNamespace('gd') . ':' . 'when';
|
---|
177 | $when = new Zend_Gdata_Extension_When();
|
---|
178 | $when->transferFromDOM($child);
|
---|
179 | $this->_when[] = $when;
|
---|
180 | break;
|
---|
181 | case $this->lookupNamespace('gd') . ':' . 'who';
|
---|
182 | $who = new Zend_Gdata_Extension_Who();
|
---|
183 | $who ->transferFromDOM($child);
|
---|
184 | $this->_who[] = $who;
|
---|
185 | break;
|
---|
186 | case $this->lookupNamespace('gd') . ':' . 'recurrence';
|
---|
187 | $recurrence = new Zend_Gdata_Extension_Recurrence();
|
---|
188 | $recurrence->transferFromDOM($child);
|
---|
189 | $this->_recurrence = $recurrence;
|
---|
190 | break;
|
---|
191 | case $this->lookupNamespace('gd') . ':' . 'eventStatus';
|
---|
192 | $eventStatus = new Zend_Gdata_Extension_EventStatus();
|
---|
193 | $eventStatus->transferFromDOM($child);
|
---|
194 | $this->_eventStatus = $eventStatus;
|
---|
195 | break;
|
---|
196 | case $this->lookupNamespace('gd') . ':' . 'comments';
|
---|
197 | $comments = new Zend_Gdata_Extension_Comments();
|
---|
198 | $comments->transferFromDOM($child);
|
---|
199 | $this->_comments = $comments;
|
---|
200 | break;
|
---|
201 | case $this->lookupNamespace('gd') . ':' . 'transparency';
|
---|
202 | $transparency = new Zend_Gdata_Extension_Transparency();
|
---|
203 | $transparency ->transferFromDOM($child);
|
---|
204 | $this->_transparency = $transparency;
|
---|
205 | break;
|
---|
206 | case $this->lookupNamespace('gd') . ':' . 'visibility';
|
---|
207 | $visiblity = new Zend_Gdata_Extension_Visibility();
|
---|
208 | $visiblity ->transferFromDOM($child);
|
---|
209 | $this->_visibility = $visiblity;
|
---|
210 | break;
|
---|
211 | case $this->lookupNamespace('gd') . ':' . 'recurrenceException';
|
---|
212 | require_once 'Zend/Gdata/Extension/RecurrenceException.php';
|
---|
213 | $recurrenceException = new Zend_Gdata_Extension_RecurrenceException();
|
---|
214 | $recurrenceException ->transferFromDOM($child);
|
---|
215 | $this->_recurrenceException[] = $recurrenceException;
|
---|
216 | break;
|
---|
217 | case $this->lookupNamespace('gd') . ':' . 'originalEvent';
|
---|
218 | $originalEvent = new Zend_Gdata_Extension_OriginalEvent();
|
---|
219 | $originalEvent ->transferFromDOM($child);
|
---|
220 | $this->_originalEvent = $originalEvent;
|
---|
221 | break;
|
---|
222 | case $this->lookupNamespace('gd') . ':' . 'extendedProperty';
|
---|
223 | $extProp = new Zend_Gdata_Extension_ExtendedProperty();
|
---|
224 | $extProp->transferFromDOM($child);
|
---|
225 | $this->_extendedProperty[] = $extProp;
|
---|
226 | break;
|
---|
227 | case $this->lookupNamespace('gd') . ':' . 'entryLink':
|
---|
228 | $entryLink = new Zend_Gdata_Extension_EntryLink();
|
---|
229 | $entryLink->transferFromDOM($child);
|
---|
230 | $this->_entryLink = $entryLink;
|
---|
231 | break;
|
---|
232 |
|
---|
233 | default:
|
---|
234 | parent::takeChildFromDOM($child);
|
---|
235 | break;
|
---|
236 | }
|
---|
237 | }
|
---|
238 |
|
---|
239 | public function getWhen()
|
---|
240 | {
|
---|
241 | return $this->_when;
|
---|
242 | }
|
---|
243 |
|
---|
244 | /**
|
---|
245 | * @param array $value
|
---|
246 | * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
|
---|
247 | */
|
---|
248 | public function setWhen($value)
|
---|
249 | {
|
---|
250 | $this->_when = $value;
|
---|
251 | return $this;
|
---|
252 | }
|
---|
253 |
|
---|
254 | public function getWhere()
|
---|
255 | {
|
---|
256 | return $this->_where;
|
---|
257 | }
|
---|
258 |
|
---|
259 | /**
|
---|
260 | * @param array $value
|
---|
261 | * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
|
---|
262 | */
|
---|
263 | public function setWhere($value)
|
---|
264 | {
|
---|
265 | $this->_where = $value;
|
---|
266 | return $this;
|
---|
267 | }
|
---|
268 |
|
---|
269 | public function getWho()
|
---|
270 | {
|
---|
271 | return $this->_who;
|
---|
272 | }
|
---|
273 |
|
---|
274 | /**
|
---|
275 | * @param array $value
|
---|
276 | * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
|
---|
277 | */
|
---|
278 | public function setWho($value)
|
---|
279 | {
|
---|
280 | $this->_who = $value;
|
---|
281 | return $this;
|
---|
282 | }
|
---|
283 |
|
---|
284 | public function getRecurrence()
|
---|
285 | {
|
---|
286 | return $this->_recurrence;
|
---|
287 | }
|
---|
288 |
|
---|
289 | /**
|
---|
290 | * @param array $value
|
---|
291 | * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
|
---|
292 | */
|
---|
293 | public function setRecurrence($value)
|
---|
294 | {
|
---|
295 | $this->_recurrence = $value;
|
---|
296 | return $this;
|
---|
297 | }
|
---|
298 |
|
---|
299 | public function getEventStatus()
|
---|
300 | {
|
---|
301 | return $this->_eventStatus;
|
---|
302 | }
|
---|
303 |
|
---|
304 | /**
|
---|
305 | * @param array $value
|
---|
306 | * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
|
---|
307 | */
|
---|
308 | public function setEventStatus($value)
|
---|
309 | {
|
---|
310 | $this->_eventStatus = $value;
|
---|
311 | return $this;
|
---|
312 | }
|
---|
313 |
|
---|
314 | public function getComments()
|
---|
315 | {
|
---|
316 | return $this->_comments;
|
---|
317 | }
|
---|
318 |
|
---|
319 | /**
|
---|
320 | * @param array $value
|
---|
321 | * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
|
---|
322 | */
|
---|
323 | public function setComments($value)
|
---|
324 | {
|
---|
325 | $this->_comments = $value;
|
---|
326 | return $this;
|
---|
327 | }
|
---|
328 |
|
---|
329 | public function getTransparency()
|
---|
330 | {
|
---|
331 | return $this->_transparency;
|
---|
332 | }
|
---|
333 |
|
---|
334 | /**
|
---|
335 | * @param Zend_Gdata_Transparency $value
|
---|
336 | * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
|
---|
337 | */
|
---|
338 | public function setTransparency($value)
|
---|
339 | {
|
---|
340 | $this->_transparency = $value;
|
---|
341 | return $this;
|
---|
342 | }
|
---|
343 |
|
---|
344 | public function getVisibility()
|
---|
345 | {
|
---|
346 | return $this->_visibility;
|
---|
347 | }
|
---|
348 |
|
---|
349 | /**
|
---|
350 | * @param Zend_Gdata_Visibility $value
|
---|
351 | * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
|
---|
352 | */
|
---|
353 | public function setVisibility($value)
|
---|
354 | {
|
---|
355 | $this->_visibility = $value;
|
---|
356 | return $this;
|
---|
357 | }
|
---|
358 |
|
---|
359 | public function getRecurrenceExcption()
|
---|
360 | {
|
---|
361 | return $this->_recurrenceException;
|
---|
362 | }
|
---|
363 |
|
---|
364 | /**
|
---|
365 | * @param array $value
|
---|
366 | * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
|
---|
367 | */
|
---|
368 | public function setRecurrenceException($value)
|
---|
369 | {
|
---|
370 | $this->_recurrenceException = $value;
|
---|
371 | return $this;
|
---|
372 | }
|
---|
373 |
|
---|
374 | public function getExtendedProperty()
|
---|
375 | {
|
---|
376 | return $this->_extendedProperty;
|
---|
377 | }
|
---|
378 |
|
---|
379 | /**
|
---|
380 | * @param array $value
|
---|
381 | * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
|
---|
382 | */
|
---|
383 | public function setExtendedProperty($value)
|
---|
384 | {
|
---|
385 | $this->_extendedProperty = $value;
|
---|
386 | return $this;
|
---|
387 | }
|
---|
388 |
|
---|
389 | public function getOriginalEvent()
|
---|
390 | {
|
---|
391 | return $this->_originalEvent;
|
---|
392 | }
|
---|
393 |
|
---|
394 | /**
|
---|
395 | * @param Zend_Gdata_Extension_OriginalEvent $value
|
---|
396 | * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
|
---|
397 | */
|
---|
398 | public function setOriginalEvent($value)
|
---|
399 | {
|
---|
400 | $this->_originalEvent = $value;
|
---|
401 | return $this;
|
---|
402 | }
|
---|
403 |
|
---|
404 | /**
|
---|
405 | * Get this entry's EntryLink element.
|
---|
406 | *
|
---|
407 | * @return Zend_Gdata_Extension_EntryLink The requested entry.
|
---|
408 | */
|
---|
409 | public function getEntryLink()
|
---|
410 | {
|
---|
411 | return $this->_entryLink;
|
---|
412 | }
|
---|
413 |
|
---|
414 | /**
|
---|
415 | * Set the child's EntryLink element.
|
---|
416 | *
|
---|
417 | * @param Zend_Gdata_Extension_EntryLink $value The desired value for this attribute.
|
---|
418 | * @return Zend_Gdata_Extension_Who The element being modified.
|
---|
419 | */
|
---|
420 | public function setEntryLink($value)
|
---|
421 | {
|
---|
422 | $this->_entryLink = $value;
|
---|
423 | return $this;
|
---|
424 | }
|
---|
425 |
|
---|
426 |
|
---|
427 | }
|
---|