import v1.0.0-RC4 | 2009-05-20

This commit is contained in:
2019-07-17 22:08:50 +02:00
commit b484e522e8
2459 changed files with 1038434 additions and 0 deletions

View File

@ -0,0 +1,160 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* @see Zend_Gdata_Entry
*/
require_once 'Zend/Gdata/Entry.php';
/**
* @see Zend_Gdata_Kind_EventEntry
*/
require_once 'Zend/Gdata/Kind/EventEntry.php';
/**
* @see Zend_Gdata_Calendar_Extension_SendEventNotifications
*/
require_once 'Zend/Gdata/Calendar/Extension/SendEventNotifications.php';
/**
* @see Zend_Gdata_Calendar_Extension_Timezone
*/
require_once 'Zend/Gdata/Calendar/Extension/Timezone.php';
/**
* @see Zend_Gdata_Calendar_Extension_Link
*/
require_once 'Zend/Gdata/Calendar/Extension/Link.php';
/**
* Data model class for a Google Calendar Event Entry
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_Calendar_EventEntry extends Zend_Gdata_Kind_EventEntry
{
protected $_entryClassName = 'Zend_Gdata_Calendar_EventEntry';
protected $_sendEventNotifications = null;
protected $_timezone = null;
protected $_quickadd = null;
public function __construct($element = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
parent::__construct($element);
}
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
{
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
if ($this->_sendEventNotifications != null) {
$element->appendChild($this->_sendEventNotifications->getDOM($element->ownerDocument));
}
if ($this->_timezone != null) {
$element->appendChild($this->_timezone->getDOM($element->ownerDocument));
}
if ($this->_quickadd != null) {
$element->appendChild($this->_quickadd->getDOM($element->ownerDocument));
}
return $element;
}
protected function takeChildFromDOM($child)
{
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gCal') . ':' . 'sendEventNotifications';
$sendEventNotifications = new Zend_Gdata_Calendar_Extension_SendEventNotifications();
$sendEventNotifications->transferFromDOM($child);
$this->_sendEventNotifications = $sendEventNotifications;
break;
case $this->lookupNamespace('gCal') . ':' . 'timezone';
$timezone = new Zend_Gdata_Calendar_Extension_Timezone();
$timezone->transferFromDOM($child);
$this->_timezone = $timezone;
break;
case $this->lookupNamespace('atom') . ':' . 'link';
$link = new Zend_Gdata_Calendar_Extension_Link();
$link->transferFromDOM($child);
$this->_link[] = $link;
break;
case $this->lookupNamespace('gCal') . ':' . 'quickadd';
$quickadd = new Zend_Gdata_Calendar_Extension_QuickAdd();
$quickadd->transferFromDOM($child);
$this->_quickadd = $quickadd;
break;
default:
parent::takeChildFromDOM($child);
break;
}
}
public function getSendEventNotifications()
{
return $this->_sendEventNotifications;
}
public function setSendEventNotifications($value)
{
$this->_sendEventNotifications = $value;
return $this;
}
public function getTimezone()
{
return $this->_timezone;
}
/**
* @param Zend_Gdata_Calendar_Extension_Timezone $value
* @return Zend_Gdata_Extension_EventEntry Provides a fluent interface
*/
public function setTimezone($value)
{
$this->_timezone = $value;
return $this;
}
public function getQuickAdd()
{
return $this->_quickadd;
}
/**
* @param Zend_Gdata_Calendar_Extension_QuickAdd $value
* @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
*/
public function setQuickAdd($value)
{
$this->_quickadd = $value;
return $this;
}
}

View File

@ -0,0 +1,107 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* @see Zend_Gdata_Feed
*/
require_once 'Zend/Gdata/Feed.php';
/**
* @see Zend_Gdata_Extension_Timezone
*/
require_once 'Zend/Gdata/Calendar/Extension/Timezone.php';
/**
* Data model for a Google Calendar feed of events
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_Calendar_EventFeed extends Zend_Gdata_Feed
{
protected $_timezone = null;
/**
* The classname for individual feed elements.
*
* @var string
*/
protected $_entryClassName = 'Zend_Gdata_Calendar_EventEntry';
/**
* The classname for the feed.
*
* @var string
*/
protected $_feedClassName = 'Zend_Gdata_Calendar_EventFeed';
public function __construct($element = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
parent::__construct($element);
}
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
{
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
if ($this->_timezone != null) {
$element->appendChild($this->_timezone->getDOM($element->ownerDocument));
}
return $element;
}
protected function takeChildFromDOM($child)
{
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gCal') . ':' . 'timezone';
$timezone = new Zend_Gdata_Calendar_Extension_Timezone();
$timezone->transferFromDOM($child);
$this->_timezone = $timezone;
break;
default:
parent::takeChildFromDOM($child);
break;
}
}
public function getTimezone()
{
return $this->_timezone;
}
public function setTimezone($value)
{
$this->_timezone = $value;
return $this;
}
}

View File

@ -0,0 +1,445 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* Zend_Gdata_App_util
*/
require_once('Zend/Gdata/App/Util.php');
/**
* Zend_Gdata_Query
*/
require_once('Zend/Gdata/Query.php');
/**
* Assists in constructing queries for Google Calendar events
*
* @link http://code.google.com/apis/gdata/calendar/
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_Calendar_EventQuery extends Zend_Gdata_Query
{
const CALENDAR_FEED_URI = 'http://www.google.com/calendar/feeds';
protected $_defaultFeedUri = self::CALENDAR_FEED_URI;
protected $_comments = null;
protected $_user = null;
protected $_visibility = null;
protected $_projection = null;
protected $_event = null;
/**
* Create Gdata_Calendar_EventQuery object. If a URL is provided,
* it becomes the base URL, and additional URL components may be
* appended. For instance, if $url is 'http://www.foo.com', the
* default URL constructed will be 'http://www.foo.com/default/public/full'
*
* @param string $url The URL to use as the base path for requests
*/
public function __construct($url = null)
{
parent::__construct($url);
}
/**
* @param string $value
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
*/
public function setComments($value)
{
$this->_comments = $value;
return $this;
}
/**
* @param string $value
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
*/
public function setEvent($value)
{
$this->_event = $value;
return $this;
}
/**
* @param string $value
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
*/
public function setProjection($value)
{
$this->_projection = $value;
return $this;
}
/**
* @param string $value
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
*/
public function setUser($value)
{
$this->_user = $value;
return $this;
}
/**
* @param bool $value
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
*/
public function setVisibility($value)
{
$this->_visibility = $value;
return $this;
}
/**
* @return string comments
*/
public function getComments()
{
return $this->_comments;
}
/**
* @return string event
*/
public function getEvent()
{
return $this->_event;
}
/**
* @return string projection
*/
public function getProjection()
{
return $this->_projection;
}
/**
* @return string user
*/
public function getUser()
{
return $this->_user;
}
/**
* @return string visibility
*/
public function getVisibility()
{
return $this->_visibility;
}
/**
* @param int $value
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
*/
public function setStartMax($value)
{
if ($value != null) {
$this->_params['start-max'] = Zend_Gdata_App_Util::formatTimestamp($value);
} else {
unset($this->_params['start-max']);
}
return $this;
}
/**
* @param int $value
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
*/
public function setStartMin($value)
{
if ($value != null) {
$this->_params['start-min'] = Zend_Gdata_App_Util::formatTimestamp($value);
} else {
unset($this->_params['start-min']);
}
return $this;
}
/**
* @param string $value
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
*/
public function setOrderBy($value)
{
if ($value != null) {
$this->_params['orderby'] = $value;
} else {
unset($this->_params['orderby']);
}
return $this;
}
/**
* @return int start-max
*/
public function getStartMax()
{
if (array_key_exists('start-max', $this->_params)) {
return $this->_params['start-max'];
} else {
return null;
}
}
/**
* @return int start-min
*/
public function getStartMin()
{
if (array_key_exists('start-min', $this->_params)) {
return $this->_params['start-min'];
} else {
return null;
}
}
/**
* @return string orderby
*/
public function getOrderBy()
{
if (array_key_exists('orderby', $this->_params)) {
return $this->_params['orderby'];
} else {
return null;
}
}
/**
* @return string sortorder
*/
public function getSortOrder()
{
if (array_key_exists('sortorder', $this->_params)) {
return $this->_params['sortorder'];
} else {
return null;
}
}
/**
* @return string sortorder
*/
public function setSortOrder($value)
{
if ($value != null) {
$this->_params['sortorder'] = $value;
} else {
unset($this->_params['sortorder']);
}
return $this;
}
/**
* @return string recurrence-expansion-start
*/
public function getRecurrenceExpansionStart()
{
if (array_key_exists('recurrence-expansion-start', $this->_params)) {
return $this->_params['recurrence-expansion-start'];
} else {
return null;
}
}
/**
* @return string recurrence-expansion-start
*/
public function setRecurrenceExpansionStart($value)
{
if ($value != null) {
$this->_params['recurrence-expansion-start'] = Zend_Gdata_App_Util::formatTimestamp($value);
} else {
unset($this->_params['recurrence-expansion-start']);
}
return $this;
}
/**
* @return string recurrence-expansion-end
*/
public function getRecurrenceExpansionEnd()
{
if (array_key_exists('recurrence-expansion-end', $this->_params)) {
return $this->_params['recurrence-expansion-end'];
} else {
return null;
}
}
/**
* @return string recurrence-expansion-end
*/
public function setRecurrenceExpansionEnd($value)
{
if ($value != null) {
$this->_params['recurrence-expansion-end'] = Zend_Gdata_App_Util::formatTimestamp($value);
} else {
unset($this->_params['recurrence-expansion-end']);
}
return $this;
}
/**
* @param string $value Also accepts bools.
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
*/
public function getSingleEvents()
{
if (array_key_exists('singleevents', $this->_params)) {
$value = $this->_params['singleevents'];
switch ($value) {
case 'true':
return true;
break;
case 'false':
return false;
break;
default:
require_once 'Zend/Gdata/App/Exception.php';
throw new Zend_Gdata_App_Exception(
'Invalid query param value for futureevents: ' .
$value . ' It must be a boolean.');
}
} else {
return null;
}
}
/**
* @param string $value Also accepts bools. If using a string, must be either "true" or "false".
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
*/
public function setSingleEvents($value)
{
if (!is_null($value)) {
if (is_bool($value)) {
$this->_params['singleevents'] = ($value?'true':'false');
} elseif ($value == 'true' | $value == 'false') {
$this->_params['singleevents'] = $value;
} else {
require_once 'Zend/Gdata/App/Exception.php';
throw new Zend_Gdata_App_Exception(
'Invalid query param value for futureevents: ' .
$value . ' It must be a boolean.');
}
} else {
unset($this->_params['singleevents']);
}
return $this;
}
/**
* @return string futureevents
*/
public function getFutureEvents()
{
if (array_key_exists('futureevents', $this->_params)) {
$value = $this->_params['futureevents'];
switch ($value) {
case 'true':
return true;
break;
case 'false':
return false;
break;
default:
require_once 'Zend/Gdata/App/Exception.php';
throw new Zend_Gdata_App_Exception(
'Invalid query param value for futureevents: ' .
$value . ' It must be a boolean.');
}
} else {
return null;
}
}
/**
* @param string $value Also accepts bools. If using a string, must be either "true" or "false" or
* an exception will be thrown on retrieval.
* @return Zend_Gdata_Calendar_EventQuery Provides a fluent interface
*/
public function setFutureEvents($value)
{
if (!is_null($value)) {
if (is_bool($value)) {
$this->_params['futureevents'] = ($value?'true':'false');
} elseif ($value == 'true' | $value == 'false') {
$this->_params['futureevents'] = $value;
} else {
require_once 'Zend/Gdata/App/Exception.php';
throw new Zend_Gdata_App_Exception(
'Invalid query param value for futureevents: ' .
$value . ' It must be a boolean.');
}
} else {
unset($this->_params['futureevents']);
}
return $this;
}
/**
* @return string url
*/
public function getQueryUrl()
{
if (isset($this->_url)) {
$uri = $this->_url;
} else {
$uri = $this->_defaultFeedUri;
}
if ($this->getUser() != null) {
$uri .= '/' . $this->getUser();
} else {
$uri .= '/default';
}
if ($this->getVisibility() != null) {
$uri .= '/' . $this->getVisibility();
} else {
$uri .= '/public';
}
if ($this->getProjection() != null) {
$uri .= '/' . $this->getProjection();
} else {
$uri .= '/full';
}
if ($this->getEvent() != null) {
$uri .= '/' . $this->getEvent();
if ($this->getComments() != null) {
$uri .= '/comments/' . $this->getComments();
}
}
$uri .= $this->getQueryString();
return $uri;
}
}

View File

@ -0,0 +1,129 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* @see Zend_Gdata_Extension
*/
require_once 'Zend/Gdata/Extension.php';
/**
* @see Zend_Gdata_Extension
*/
require_once 'Zend/Gdata/Calendar.php';
/**
* Represents the gCal:accessLevel element used by the Calendar data API
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_Calendar_Extension_AccessLevel extends Zend_Gdata_Extension
{
protected $_rootNamespace = 'gCal';
protected $_rootElement = 'accesslevel';
protected $_value = null;
/**
* Constructs a new Zend_Gdata_Calendar_Extension_AccessLevel object.
* @param string $value (optional) The text content of the element.
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
parent::__construct();
$this->_value = $value;
}
/**
* Retrieves a DOMElement which corresponds to this element and all
* child properties. This is used to build an entry back into a DOM
* and eventually XML text for sending to the server upon updates, or
* for application storage/persistence.
*
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
* @return DOMElement The DOMElement representing this element and all
* child properties.
*/
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
{
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
if ($this->_value != null) {
$element->setAttribute('value', $this->_value);
}
return $element;
}
/**
* Given a DOMNode representing an attribute, tries to map the data into
* instance members. If no mapping is defined, the name and value are
* stored in an array.
*
* @param DOMNode $attribute The DOMNode attribute needed to be handled
*/
protected function takeAttributeFromDOM($attribute)
{
switch ($attribute->localName) {
case 'value':
$this->_value = $attribute->nodeValue;
break;
default:
parent::takeAttributeFromDOM($attribute);
}
}
/**
* Get the value for this element's value attribute.
*
* @return string The attribute being modified.
*/
public function getValue()
{
return $this->_value;
}
/**
* Set the value for this element's value attribute.
*
* @param string $value The desired value for this attribute.
* @return Zend_Gdata_Calendar_Extension_Selected The element being modified.
*/
public function setValue($value)
{
$this->_value = $value;
return $this;
}
/**
* Magic toString method allows using this directly via echo
* Works best in PHP >= 4.2.0
*/
public function __toString()
{
return $this->getValue();
}
}

View File

@ -0,0 +1,124 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* @see Zend_Gdata_Extension
*/
require_once 'Zend/Gdata/Extension.php';
/**
* Represents the gCal:color element used by the Calendar data API
* to define the color of a calendar in the UI.
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_Calendar_Extension_Color extends Zend_Gdata_Extension
{
protected $_rootNamespace = 'gCal';
protected $_rootElement = 'color';
protected $_value = null;
/**
* Constructs a new Zend_Gdata_Calendar_Extension_Color object.
* @param string $value (optional) The text content of the element.
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
parent::__construct();
$this->_value = $value;
}
/**
* Retrieves a DOMElement which corresponds to this element and all
* child properties. This is used to build an entry back into a DOM
* and eventually XML text for sending to the server upon updates, or
* for application storage/persistence.
*
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
* @return DOMElement The DOMElement representing this element and all
* child properties.
*/
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
{
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
if ($this->_value != null) {
$element->setAttribute('value', $this->_value);
}
return $element;
}
/**
* Given a DOMNode representing an attribute, tries to map the data into
* instance members. If no mapping is defined, the name and value are
* stored in an array.
*
* @param DOMNode $attribute The DOMNode attribute needed to be handled
*/
protected function takeAttributeFromDOM($attribute)
{
switch ($attribute->localName) {
case 'value':
$this->_value = $attribute->nodeValue;
break;
default:
parent::takeAttributeFromDOM($attribute);
}
}
/**
* Get the value for this element's value attribute.
*
* @return string The value associated with this attribute.
*/
public function getValue()
{
return $this->_value;
}
/**
* Set the value for this element's value attribute.
*
* @param string $value The desired value for this attribute.
* @return Zend_Gdata_Calendar_Extension_Color The element being modified.
*/
public function setValue($value)
{
$this->_value = $value;
return $this;
}
/**
* Magic toString method allows using this directly via echo
* Works best in PHP >= 4.2.0
*/
public function __toString()
{
return $this->_value;
}
}

View File

@ -0,0 +1,133 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* @see Zend_Gdata_Extension
*/
require_once 'Zend/Gdata/Extension.php';
/**
* Represents the gCal:hidden element used by the Calendar data API
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_Calendar_Extension_Hidden extends Zend_Gdata_Extension
{
protected $_rootNamespace = 'gCal';
protected $_rootElement = 'hidden';
protected $_value = null;
/**
* Constructs a new Zend_Gdata_Calendar_Extension_Hidden object.
* @param bool $value (optional) The value of the element.
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
parent::__construct();
$this->_value = $value;
}
/**
* Retrieves a DOMElement which corresponds to this element and all
* child properties. This is used to build an entry back into a DOM
* and eventually XML text for sending to the server upon updates, or
* for application storage/persistence.
*
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
* @return DOMElement The DOMElement representing this element and all
* child properties.
*/
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
{
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
if ($this->_value !== null) {
$element->setAttribute('value', ($this->_value ? "true" : "false"));
}
return $element;
}
/**
* Given a DOMNode representing an attribute, tries to map the data into
* instance members. If no mapping is defined, the name and value are
* stored in an array.
*
* @param DOMNode $attribute The DOMNode attribute needed to be handled
*/
protected function takeAttributeFromDOM($attribute)
{
switch ($attribute->localName) {
case 'value':
if ($attribute->nodeValue == "true") {
$this->_value = true;
}
else if ($attribute->nodeValue == "false") {
$this->_value = false;
}
else {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException("Expected 'true' or 'false' for gCal:selected#value.");
}
break;
default:
parent::takeAttributeFromDOM($attribute);
}
}
/**
* Get the value for this element's value attribute.
*
* @return string The requested attribute.
*/
public function getValue()
{
return $this->_value;
}
/**
* Set the value for this element's value attribute.
*
* @param bool $value The desired value for this attribute.
* @return Zend_Gdata_Calendar_Extension_Hidden The element being modified.
*/
public function setValue($value)
{
$this->_value = $value;
return $this;
}
/**
* Magic toString method allows using this directly via echo
* Works best in PHP >= 4.2.0
*/
public function __toString()
{
return $this->_value;
}
}

View File

@ -0,0 +1,125 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Entry.php 3941 2007-03-14 21:36:13Z darby $
*/
/**
* @see Zend_Gdata_Entry
*/
require_once 'Zend/Gdata/App/Extension/Link.php';
/**
* @see Zend_Gdata_Entry
*/
require_once 'Zend/Gdata/Calendar/Extension/WebContent.php';
/**
* Specialized Link class for use with Calendar. Enables use of gCal extension elements.
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_Calendar_Extension_Link extends Zend_Gdata_App_Extension_Link
{
protected $_webContent = null;
/**
* Constructs a new Zend_Gdata_Calendar_Extension_Link object.
* @see Zend_Gdata_App_Extension_Link#__construct
* @param Zend_Gdata_Calendar_Extension_Webcontent $webContent
*/
public function __construct($href = null, $rel = null, $type = null,
$hrefLang = null, $title = null, $length = null, $webContent = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
parent::__construct($href, $rel, $type, $hrefLang, $title, $length);
$this->_webContent = $webContent;
}
/**
* Retrieves a DOMElement which corresponds to this element and all
* child properties. This is used to build an entry back into a DOM
* and eventually XML text for sending to the server upon updates, or
* for application storage/persistence.
*
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
* @return DOMElement The DOMElement representing this element and all
* child properties.
*/
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
{
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
if ($this->_webContent != null) {
$element->appendChild($this->_webContent->getDOM($element->ownerDocument));
}
return $element;
}
/**
* Creates individual Entry objects of the appropriate type and
* stores them as members of this entry based upon DOM data.
*
* @param DOMNode $child The DOMNode to process
*/
protected function takeChildFromDOM($child)
{
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gCal') . ':' . 'webContent':
$webContent = new Zend_Gdata_Calendar_Extension_WebContent();
$webContent->transferFromDOM($child);
$this->_webContent = $webContent;
break;
default:
parent::takeChildFromDOM($child);
break;
}
}
/**
* Get the value for this element's WebContent attribute.
*
* @return Zend_Gdata_Calendar_Extension_Webcontent The WebContent value
*/
public function getWebContent()
{
return $this->_webContent;
}
/**
* Set the value for this element's WebContent attribute.
*
* @param Zend_Gdata_Calendar_Extension_WebContent $value The desired value for this attribute.
* @return Zend_Calendar_Extension_Link The element being modified. Provides a fluent interface.
*/
public function setWebContent($value)
{
$this->_webContent = $value;
return $this;
}
}

View File

@ -0,0 +1,131 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* @see Zend_Gdata_Extension
*/
require_once 'Zend/Gdata/Extension.php';
/**
* Represents the gCal:quickAdd element used by the Calendar data API
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_Calendar_Extension_QuickAdd extends Zend_Gdata_Extension
{
protected $_rootNamespace = 'gCal';
protected $_rootElement = 'quickadd';
protected $_value = null;
/**
* Constructs a new Zend_Gdata_Calendar_Extension_QuickAdd object.
* @param string $value (optional) The text content of the element.
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
parent::__construct();
$this->_value = $value;
}
/**
* Retrieves a DOMElement which corresponds to this element and all
* child properties. This is used to build an entry back into a DOM
* and eventually XML text for sending to the server upon updates, or
* for application storage/persistence.
*
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
* @return DOMElement The DOMElement representing this element and all
* child properties.
*/
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
{
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
if ($this->_value !== null) {
$element->setAttribute('value', ($this->_value ? "true" : "false"));
}
return $element;
}
/**
* Given a DOMNode representing an attribute, tries to map the data into
* instance members. If no mapping is defined, the name and value are
* stored in an array.
*
* @param DOMNode $attribute The DOMNode attribute needed to be handled
*/
protected function takeAttributeFromDOM($attribute)
{
switch ($attribute->localName) {
case 'value':
if ($attribute->nodeValue == "true") {
$this->_value = true;
}
else if ($attribute->nodeValue == "false") {
$this->_value = false;
}
else {
throw new Zend_Gdata_App_InvalidArgumentException("Expected 'true' or 'false' for gCal:selected#value.");
}
break;
default:
parent::takeAttributeFromDOM($attribute);
}
}
/**
* Get the value for this element's value attribute.
*
* @return string The value associated with this attribute.
*/
public function getValue()
{
return $this->_value;
}
/**
* Set the value for this element's value attribute.
*
* @param string $value The desired value for this attribute.
* @return Zend_Gdata_Calendar_Extension_QuickAdd The element being modified.
*/
public function setValue($value)
{
$this->_value = $value;
return $this;
}
/**
* Magic toString method allows using this directly via echo
* Works best in PHP >= 4.2.0
*/
public function __toString()
{
return $this->getValue();
}
}

View File

@ -0,0 +1,132 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* @see Zend_Gdata_Extension
*/
require_once 'Zend/Gdata/Extension.php';
/**
* Represents the gCal:selected element used by the Calendar data API
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_Calendar_Extension_Selected extends Zend_Gdata_Extension
{
protected $_rootNamespace = 'gCal';
protected $_rootElement = 'selected';
protected $_value = null;
/**
* Constructs a new Zend_Gdata_Calendar_Extension_Selected object.
* @param bool $value (optional) The value of the element.
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
parent::__construct();
$this->_value = $value;
}
/**
* Retrieves a DOMElement which corresponds to this element and all
* child properties. This is used to build an entry back into a DOM
* and eventually XML text for sending to the server upon updates, or
* for application storage/persistence.
*
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
* @return DOMElement The DOMElement representing this element and all
* child properties.
*/
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
{
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
if ($this->_value !== null) {
$element->setAttribute('value', ($this->_value ? "true" : "false"));
}
return $element;
}
/**
* Given a DOMNode representing an attribute, tries to map the data into
* instance members. If no mapping is defined, the name and value are
* stored in an array.
*
* @param DOMNode $attribute The DOMNode attribute needed to be handled
*/
protected function takeAttributeFromDOM($attribute)
{
switch ($attribute->localName) {
case 'value':
if ($attribute->nodeValue == "true") {
$this->_value = true;
}
else if ($attribute->nodeValue == "false") {
$this->_value = false;
}
else {
require_once 'Zend/Gdata/App/InvalidArgumentException.php';
throw new Zend_Gdata_App_InvalidArgumentException("Expected 'true' or 'false' for gCal:selected#value.");
}
break;
default:
parent::takeAttributeFromDOM($attribute);
}
}
/**
* Get the value for this element's value attribute.
*
* @return bool The value associated with this attribute.
*/
public function getValue()
{
return $this->_value;
}
/**
* Set the value for this element's value attribute.
*
* @param bool $value The desired value for this attribute.
* @return Zend_Gdata_Calendar_Extension_Selected The element being modified.
*/
public function setValue($value)
{
$this->_value = $value;
return $this;
}
/**
* Magic toString method allows using this directly via echo
* Works best in PHP >= 4.2.0
*/
public function __toString()
{
return $this->_value;
}
}

View File

@ -0,0 +1,131 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* @see Zend_Gdata_Extension
*/
require_once 'Zend/Gdata/Extension.php';
/**
* Data model class to represent an entry's sendEventNotifications
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_Calendar_Extension_SendEventNotifications extends Zend_Gdata_Extension
{
protected $_rootNamespace = 'gCal';
protected $_rootElement = 'sendEventNotifications';
protected $_value = null;
/**
* Constructs a new Zend_Gdata_Extension_SendEventNotifications object.
* @param bool $value (optional) SendEventNotifications value as URI.
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
parent::__construct();
$this->_value = $value;
}
/**
* Retrieves a DOMElement which corresponds to this element and all
* child properties. This is used to build an entry back into a DOM
* and eventually XML text for sending to the server upon updates, or
* for application storage/persistence.
*
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
* @return DOMElement The DOMElement representing this element and all
* child properties.
*/
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
{
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
if ($this->_value !== null) {
$element->setAttribute('value', ($this->_value ? "true" : "false"));
}
return $element;
}
/**
* Given a DOMNode representing an attribute, tries to map the data into
* instance members. If no mapping is defined, the name and value are
* stored in an array.
*
* @param DOMNode $attribute The DOMNode attribute needed to be handled
*/
protected function takeAttributeFromDOM($attribute)
{
switch ($attribute->localName) {
case 'value':
if ($attribute->nodeValue == "true") {
$this->_value = true;
}
else if ($attribute->nodeValue == "false") {
$this->_value = false;
}
else {
throw new Zend_Gdata_App_InvalidArgumentException("Expected 'true' or 'false' for gCal:selected#value.");
}
break;
default:
parent::takeAttributeFromDOM($attribute);
}
}
/**
* Get the value for this element's Value attribute.
*
* @return string The requested attribute.
*/
public function getValue()
{
return $this->_value;
}
/**
* Set the value for this element's Value attribute.
*
* @param string $value The desired value for this attribute.
* @return Zend_Gdata_Extension_SendEventNotifications The element being modified.
*/
public function setValue($value)
{
$this->_value = $value;
return $this;
}
/**
* Magic toString method allows using this directly via echo
* Works best in PHP >= 4.2.0
*/
public function __toString()
{
return $this->getValue();
}
}

View File

@ -0,0 +1,123 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* @see Zend_Gdata_Extension
*/
require_once 'Zend/Gdata/Extension.php';
/**
* Represents the gCal:timezone element used by the Calendar data API
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_Calendar_Extension_Timezone extends Zend_Gdata_Extension
{
protected $_rootNamespace = 'gCal';
protected $_rootElement = 'timezone';
protected $_value = null;
/**
* Constructs a new Zend_Gdata_Calendar_Extension_Timezone object.
* @param string $value (optional) The text content of the element.
*/
public function __construct($value = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
parent::__construct();
$this->_value = $value;
}
/**
* Retrieves a DOMElement which corresponds to this element and all
* child properties. This is used to build an entry back into a DOM
* and eventually XML text for sending to the server upon updates, or
* for application storage/persistence.
*
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
* @return DOMElement The DOMElement representing this element and all
* child properties.
*/
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
{
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
if ($this->_value != null) {
$element->setAttribute('value', $this->_value);
}
return $element;
}
/**
* Given a DOMNode representing an attribute, tries to map the data into
* instance members. If no mapping is defined, the name and value are
* stored in an array.
*
* @param DOMNode $attribute The DOMNode attribute needed to be handled
*/
protected function takeAttributeFromDOM($attribute)
{
switch ($attribute->localName) {
case 'value':
$this->_value = $attribute->nodeValue;
break;
default:
parent::takeAttributeFromDOM($attribute);
}
}
/**
* Get the value for this element's value attribute.
*
* @return string The value associated with this attribute.
*/
public function getValue()
{
return $this->_value;
}
/**
* Set the value for this element's value attribute.
*
* @param string $value The desired value for this attribute.
* @return Zend_Gdata_Calendar_Extension_Timezone The element being modified.
*/
public function setValue($value)
{
$this->_value = $value;
return $this;
}
/**
* Magic toString method allows using this directly via echo
* Works best in PHP >= 4.2.0
*/
public function __toString()
{
return $this->getValue();
}
}

View File

@ -0,0 +1,176 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* @see Zend_Gdata_Extension
*/
require_once 'Zend/Gdata/Extension.php';
/**
* Represents the gCal:webContent element used by the Calendar data API
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_Calendar_Extension_WebContent extends Zend_Gdata_App_Extension
{
protected $_rootNamespace = 'gCal';
protected $_rootElement = 'webContent';
protected $_url = null;
protected $_height = null;
protected $_width = null;
/**
* Constructs a new Zend_Gdata_Calendar_Extension_WebContent object.
* @param string $url (optional) The value for this element's URL attribute.
* @param string $height (optional) The value for this element's height attribute.
* @param string $width (optional) The value for this element's width attribute.
*/
public function __construct($url = null, $height = null, $width = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
parent::__construct();
$this->_url = $url;
$this->_height = $height;
$this->_width = $width;
}
/**
* Retrieves a DOMElement which corresponds to this element and all
* child properties. This is used to build an entry back into a DOM
* and eventually XML text for sending to the server upon updates, or
* for application storage/persistence.
*
* @param DOMDocument $doc The DOMDocument used to construct DOMElements
* @return DOMElement The DOMElement representing this element and all
* child properties.
*/
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
{
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
if ($this->url != null) {
$element->setAttribute('url', $this->_url);
}
if ($this->height != null) {
$element->setAttribute('height', $this->_height);
}
if ($this->width != null) {
$element->setAttribute('width', $this->_width);
}
return $element;
}
/**
* Given a DOMNode representing an attribute, tries to map the data into
* instance members. If no mapping is defined, the name and value are
* stored in an array.
*
* @param DOMNode $attribute The DOMNode attribute needed to be handled
*/
protected function takeAttributeFromDOM($attribute)
{
switch ($attribute->localName) {
case 'url':
$this->_url = $attribute->nodeValue;
break;
case 'height':
$this->_height = $attribute->nodeValue;
break;
case 'width':
$this->_width = $attribute->nodeValue;
break;
default:
parent::takeAttributeFromDOM($attribute);
}
}
/**
* Get the value for this element's URL attribute.
*
* @return string The desired value for this attribute.
*/
public function getURL()
{
return $this->_url;
}
/**
* Set the value for this element's URL attribute.
*
* @param bool $value The desired value for this attribute.
* @return Zend_Gdata_Calendar_Extension_WebContent The element being modified.
*/
public function setURL($value)
{
$this->_url = $value;
return $this;
}
/**
* Get the value for this element's height attribute.
*
* @return int The desired value for this attribute.
*/
public function getHeight()
{
return $this->_height;
}
/**
* Set the value for this element's height attribute.
*
* @param int $value The desired value for this attribute.
* @return Zend_Gdata_Calendar_Extension_WebContent The element being modified.
*/
public function setHeight($value)
{
$this->_height = $value;
return $this;
}
/**
* Get the value for this element's height attribute.
*
* @return int The desired value for this attribute.
*/
public function getWidth()
{
return $this->_width;
}
/**
* Set the value for this element's height attribute.
*
* @param int $value The desired value for this attribute.
* @return Zend_Gdata_Calendar_Extension_WebContent The element being modified.
*/
public function setWidth($value)
{
$this->_width = $value;
return $this;
}
}

View File

@ -0,0 +1,246 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* @see Zend_Gdata_Entry
*/
require_once 'Zend/Gdata/Entry.php';
/**
* @see Zend_Calendar_Extension_AccessLevel
*/
require_once 'Zend/Gdata/Calendar/Extension/AccessLevel.php';
/**
* @see Zend_Calendar_Extension_Color
*/
require_once 'Zend/Gdata/Calendar/Extension/Color.php';
/**
* @see Zend_Calendar_Extension_Hidden
*/
require_once 'Zend/Gdata/Calendar/Extension/Hidden.php';
/**
* @see Zend_Calendar_Extension_Selected
*/
require_once 'Zend/Gdata/Calendar/Extension/Selected.php';
/**
* @see Zend_Gdata_Extension_EventStatus
*/
require_once 'Zend/Gdata/Extension/EventStatus.php';
/**
* @see Zend_Gdata_Extension_Visibility
*/
require_once 'Zend/Gdata/Extension/Visibility.php';
/**
* @see Zend_Extension_Where
*/
require_once 'Zend/Gdata/Extension/Where.php';
/**
* Represents a Calendar entry in the Calendar data API meta feed of a user's
* calendars.
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_Calendar_ListEntry extends Zend_Gdata_Entry
{
protected $_color = null;
protected $_accessLevel = null;
protected $_hidden = null;
protected $_selected = null;
protected $_timezone = null;
protected $_where = array();
public function __construct($element = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
parent::__construct($element);
}
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
{
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
if ($this->_accessLevel != null) {
$element->appendChild($this->_accessLevel->getDOM($element->ownerDocument));
}
if ($this->_color != null) {
$element->appendChild($this->_color->getDOM($element->ownerDocument));
}
if ($this->_hidden != null) {
$element->appendChild($this->_hidden->getDOM($element->ownerDocument));
}
if ($this->_selected != null) {
$element->appendChild($this->_selected->getDOM($element->ownerDocument));
}
if ($this->_timezone != null) {
$element->appendChild($this->_timezone->getDOM($element->ownerDocument));
}
if ($this->_where != null) {
foreach ($this->_where as $where) {
$element->appendChild($where->getDOM($element->ownerDocument));
}
}
return $element;
}
protected function takeChildFromDOM($child)
{
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gCal') . ':' . 'accesslevel';
$accessLevel = new Zend_Gdata_Calendar_Extension_AccessLevel();
$accessLevel->transferFromDOM($child);
$this->_accessLevel = $accessLevel;
break;
case $this->lookupNamespace('gCal') . ':' . 'color';
$color = new Zend_Gdata_Calendar_Extension_Color();
$color->transferFromDOM($child);
$this->_color = $color;
break;
case $this->lookupNamespace('gCal') . ':' . 'hidden';
$hidden = new Zend_Gdata_Calendar_Extension_Hidden();
$hidden->transferFromDOM($child);
$this->_hidden = $hidden;
break;
case $this->lookupNamespace('gCal') . ':' . 'selected';
$selected = new Zend_Gdata_Calendar_Extension_Selected();
$selected->transferFromDOM($child);
$this->_selected = $selected;
break;
case $this->lookupNamespace('gCal') . ':' . 'timezone';
$timezone = new Zend_Gdata_Calendar_Extension_Timezone();
$timezone->transferFromDOM($child);
$this->_timezone = $timezone;
break;
case $this->lookupNamespace('gd') . ':' . 'where';
$where = new Zend_Gdata_Extension_Where();
$where->transferFromDOM($child);
$this->_where[] = $where;
break;
default:
parent::takeChildFromDOM($child);
break;
}
}
public function getAccessLevel()
{
return $this->_accessLevel;
}
/**
* @param Zend_Gdata_Calendar_Extension_AccessLevel $value
* @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
*/
public function setAccessLevel($value)
{
$this->_accessLevel = $value;
return $this;
}
public function getColor()
{
return $this->_color;
}
/**
* @param Zend_Gdata_Calendar_Extension_Color $value
* @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
*/
public function setColor($value)
{
$this->_color = $value;
return $this;
}
public function getHidden()
{
return $this->_hidden;
}
/**
* @param Zend_Gdata_Calendar_Extension_Hidden $value
* @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
*/
public function setHidden($value)
{
$this->_hidden = $value;
return $this;
}
public function getSelected()
{
return $this->_selected;
}
/**
* @param Zend_Gdata_Calendar_Extension_Selected $value
* @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
*/
public function setSelected($value)
{
$this->_selected = $value;
return $this;
}
public function getTimezone()
{
return $this->_timezone;
}
/**
* @param Zend_Gdata_Calendar_Extension_Timezone $value
* @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
*/
public function setTimezone($value)
{
$this->_timezone = $value;
return $this;
}
public function getWhere()
{
return $this->_where;
}
/**
* @param Zend_Gdata_Extension_Where $value
* @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
*/
public function setWhere($value)
{
$this->_where = $value;
return $this;
}
}

View File

@ -0,0 +1,106 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Gdata
* @subpackage Calendar
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* @see Zend_Gdata_Feed
*/
require_once 'Zend/Gdata/Feed.php';
/**
* @see Zend_Gdata_Extension_Timezone
*/
require_once 'Zend/Gdata/Calendar/Extension/Timezone.php';
/**
* Represents the meta-feed list of calendars
*
* @category Zend
* @package Zend_Gdata
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_Calendar_ListFeed extends Zend_Gdata_Feed
{
protected $_timezone = null;
/**
* The classname for individual feed elements.
*
* @var string
*/
protected $_entryClassName = 'Zend_Gdata_Calendar_ListEntry';
/**
* The classname for the feed.
*
* @var string
*/
protected $_feedClassName = 'Zend_Gdata_Calendar_ListFeed';
public function __construct($element = null)
{
foreach (Zend_Gdata_Calendar::$namespaces as $nsPrefix => $nsUri) {
$this->registerNamespace($nsPrefix, $nsUri);
}
parent::__construct($element);
}
public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
{
$element = parent::getDOM($doc, $majorVersion, $minorVersion);
if ($this->_timezone != null) {
$element->appendChild($this->_timezone->getDOM($element->ownerDocument));
}
return $element;
}
protected function takeChildFromDOM($child)
{
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gCal') . ':' . 'timezone';
$timezone = new Zend_Gdata_Calendar_Extension_Timezone();
$timezone->transferFromDOM($child);
$this->_timezone = $timezone;
break;
default:
parent::takeChildFromDOM($child);
break;
}
}
public function getTimezone()
{
return $this->_timezone;
}
/**
* @param Zend_Gdata_Calendar_Extension_Timezone $value
* @return Zend_Gdata_Extension_ListEntry Provides a fluent interface
*/
public function setTimezone($value)
{
$this->_timezone = $value;
return $this;
}
}