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.
18 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id: EventEntry.php 16971 2009-07-22 18:05:45Z mikaelkael $
24 * @see Zend_Gdata_Entry
26 require_once 'Zend/Gdata/Entry.php';
29 * @see Zend_Gdata_App_Extension
31 require_once 'Zend/Gdata/App/Extension.php';
34 * @see Zend_Gdata_Extension_Where
36 require_once 'Zend/Gdata/Extension/Where.php';
39 * @see Zend_Gdata_Extension_When
41 require_once 'Zend/Gdata/Extension/When.php';
44 * @see Zend_Gdata_Extension_Who
46 require_once 'Zend/Gdata/Extension/Who.php';
49 * @see Zend_Gdata_Extension_Recurrence
51 require_once 'Zend/Gdata/Extension/Recurrence.php';
54 * @see Zend_Gdata_Extension_EventStatus
56 require_once 'Zend/Gdata/Extension/EventStatus.php';
59 * @see Zend_Gdata_Extension_Comments
61 require_once 'Zend/Gdata/Extension/Comments.php';
64 * @see Zend_Gdata_Extension_Transparency
66 require_once 'Zend/Gdata/Extension/Transparency.php';
69 * @see Zend_Gdata_Extension_Visibility
71 require_once 'Zend/Gdata/Extension/Visibility.php';
74 * @see Zend_Gdata_Extension_ExtendedProperty
76 require_once 'Zend/Gdata/Extension/ExtendedProperty.php';
79 * @see Zend_Gdata_Extension_OriginalEvent
81 require_once 'Zend/Gdata/Extension/OriginalEvent.php';
84 * @see Zend_Gdata_Extension_EntryLink
86 require_once 'Zend/Gdata/Extension/EntryLink.php';
89 * Data model for the Gdata Event "Kind". Google Calendar has a separate
90 * EventEntry class which extends this.
95 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
96 * @license http://framework.zend.com/license/new-bsd New BSD License
98 class Zend_Gdata_Kind_EventEntry
extends Zend_Gdata_Entry
100 protected $_who = array();
101 protected $_when = array();
102 protected $_where = array();
103 protected $_recurrence = null;
104 protected $_eventStatus = null;
105 protected $_comments = null;
106 protected $_transparency = null;
107 protected $_visibility = null;
108 protected $_recurrenceException = array();
109 protected $_extendedProperty = array();
110 protected $_originalEvent = null;
111 protected $_entryLink = null;
113 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
115 $element = parent
::getDOM($doc, $majorVersion, $minorVersion);
116 if ($this->_who
!= null) {
117 foreach ($this->_who
as $who) {
118 $element->appendChild($who->getDOM($element->ownerDocument
));
121 if ($this->_when
!= null) {
122 foreach ($this->_when
as $when) {
123 $element->appendChild($when->getDOM($element->ownerDocument
));
126 if ($this->_where
!= null) {
127 foreach ($this->_where
as $where) {
128 $element->appendChild($where->getDOM($element->ownerDocument
));
131 if ($this->_recurrenceException
!= null) {
132 foreach ($this->_recurrenceException
as $recurrenceException) {
133 $element->appendChild($recurrenceException->getDOM($element->ownerDocument
));
136 if ($this->_extendedProperty
!= null) {
137 foreach ($this->_extendedProperty
as $extProp) {
138 $element->appendChild($extProp->getDOM($element->ownerDocument
));
142 if ($this->_recurrence
!= null) {
143 $element->appendChild($this->_recurrence
->getDOM($element->ownerDocument
));
145 if ($this->_eventStatus
!= null) {
146 $element->appendChild($this->_eventStatus
->getDOM($element->ownerDocument
));
148 if ($this->_comments
!= null) {
149 $element->appendChild($this->_comments
->getDOM($element->ownerDocument
));
151 if ($this->_transparency
!= null) {
152 $element->appendChild($this->_transparency
->getDOM($element->ownerDocument
));
154 if ($this->_visibility
!= null) {
155 $element->appendChild($this->_visibility
->getDOM($element->ownerDocument
));
157 if ($this->_originalEvent
!= null) {
158 $element->appendChild($this->_originalEvent
->getDOM($element->ownerDocument
));
160 if ($this->_entryLink
!= null) {
161 $element->appendChild($this->_entryLink
->getDOM($element->ownerDocument
));
168 protected function takeChildFromDOM($child)
170 $absoluteNodeName = $child->namespaceURI
. ':' . $child->localName
;
171 switch ($absoluteNodeName) {
172 case $this->lookupNamespace('gd') . ':' . 'where';
173 $where = new Zend_Gdata_Extension_Where();
174 $where->transferFromDOM($child);
175 $this->_where
[] = $where;
177 case $this->lookupNamespace('gd') . ':' . 'when';
178 $when = new Zend_Gdata_Extension_When();
179 $when->transferFromDOM($child);
180 $this->_when
[] = $when;
182 case $this->lookupNamespace('gd') . ':' . 'who';
183 $who = new Zend_Gdata_Extension_Who();
184 $who ->transferFromDOM($child);
185 $this->_who
[] = $who;
187 case $this->lookupNamespace('gd') . ':' . 'recurrence';
188 $recurrence = new Zend_Gdata_Extension_Recurrence();
189 $recurrence->transferFromDOM($child);
190 $this->_recurrence
= $recurrence;
192 case $this->lookupNamespace('gd') . ':' . 'eventStatus';
193 $eventStatus = new Zend_Gdata_Extension_EventStatus();
194 $eventStatus->transferFromDOM($child);
195 $this->_eventStatus
= $eventStatus;
197 case $this->lookupNamespace('gd') . ':' . 'comments';
198 $comments = new Zend_Gdata_Extension_Comments();
199 $comments->transferFromDOM($child);
200 $this->_comments
= $comments;
202 case $this->lookupNamespace('gd') . ':' . 'transparency';
203 $transparency = new Zend_Gdata_Extension_Transparency();
204 $transparency ->transferFromDOM($child);
205 $this->_transparency
= $transparency;
207 case $this->lookupNamespace('gd') . ':' . 'visibility';
208 $visiblity = new Zend_Gdata_Extension_Visibility();
209 $visiblity ->transferFromDOM($child);
210 $this->_visibility
= $visiblity;
212 case $this->lookupNamespace('gd') . ':' . 'recurrenceException';
213 require_once 'Zend/Gdata/Extension/RecurrenceException.php';
214 $recurrenceException = new Zend_Gdata_Extension_RecurrenceException();
215 $recurrenceException ->transferFromDOM($child);
216 $this->_recurrenceException
[] = $recurrenceException;
218 case $this->lookupNamespace('gd') . ':' . 'originalEvent';
219 $originalEvent = new Zend_Gdata_Extension_OriginalEvent();
220 $originalEvent ->transferFromDOM($child);
221 $this->_originalEvent
= $originalEvent;
223 case $this->lookupNamespace('gd') . ':' . 'extendedProperty';
224 $extProp = new Zend_Gdata_Extension_ExtendedProperty();
225 $extProp->transferFromDOM($child);
226 $this->_extendedProperty
[] = $extProp;
228 case $this->lookupNamespace('gd') . ':' . 'entryLink':
229 $entryLink = new Zend_Gdata_Extension_EntryLink();
230 $entryLink->transferFromDOM($child);
231 $this->_entryLink
= $entryLink;
235 parent
::takeChildFromDOM($child);
240 public function getWhen()
246 * @param array $value
247 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
249 public function setWhen($value)
251 $this->_when
= $value;
255 public function getWhere()
257 return $this->_where
;
261 * @param array $value
262 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
264 public function setWhere($value)
266 $this->_where
= $value;
270 public function getWho()
276 * @param array $value
277 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
279 public function setWho($value)
281 $this->_who
= $value;
285 public function getRecurrence()
287 return $this->_recurrence
;
291 * @param array $value
292 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
294 public function setRecurrence($value)
296 $this->_recurrence
= $value;
300 public function getEventStatus()
302 return $this->_eventStatus
;
306 * @param array $value
307 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
309 public function setEventStatus($value)
311 $this->_eventStatus
= $value;
315 public function getComments()
317 return $this->_comments
;
321 * @param array $value
322 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
324 public function setComments($value)
326 $this->_comments
= $value;
330 public function getTransparency()
332 return $this->_transparency
;
336 * @param Zend_Gdata_Transparency $value
337 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
339 public function setTransparency($value)
341 $this->_transparency
= $value;
345 public function getVisibility()
347 return $this->_visibility
;
351 * @param Zend_Gdata_Visibility $value
352 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
354 public function setVisibility($value)
356 $this->_visibility
= $value;
360 public function getRecurrenceExcption()
362 return $this->_recurrenceException
;
366 * @param array $value
367 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
369 public function setRecurrenceException($value)
371 $this->_recurrenceException
= $value;
375 public function getExtendedProperty()
377 return $this->_extendedProperty
;
381 * @param array $value
382 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
384 public function setExtendedProperty($value)
386 $this->_extendedProperty
= $value;
390 public function getOriginalEvent()
392 return $this->_originalEvent
;
396 * @param Zend_Gdata_Extension_OriginalEvent $value
397 * @return Zend_Gdata_Kind_EventEntry Provides a fluent interface
399 public function setOriginalEvent($value)
401 $this->_originalEvent
= $value;
406 * Get this entry's EntryLink element.
408 * @return Zend_Gdata_Extension_EntryLink The requested entry.
410 public function getEntryLink()
412 return $this->_entryLink
;
416 * Set the child's EntryLink element.
418 * @param Zend_Gdata_Extension_EntryLink $value The desired value for this attribute.
419 * @return Zend_Gdata_Extension_Who The element being modified.
421 public function setEntryLink($value)
423 $this->_entryLink
= $value;