本文整理汇总了PHP中Horde_Icalendar::getAttributeValues方法的典型用法代码示例。如果您正苦于以下问题:PHP Horde_Icalendar::getAttributeValues方法的具体用法?PHP Horde_Icalendar::getAttributeValues怎么用?PHP Horde_Icalendar::getAttributeValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Horde_Icalendar
的用法示例。
在下文中一共展示了Horde_Icalendar::getAttributeValues方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _handlevEventRecurrence
/**
* Parses the various exception related fields. Only deal with the EXDATE
* field here.
*
* @param Horde_Icalendar $vEvent The vEvent part.
*/
protected function _handlevEventRecurrence($vEvent)
{
// Recurrence.
try {
$rrule = $vEvent->getAttribute('RRULE');
if (!is_array($rrule)) {
$this->recurrence = new Horde_Date_Recurrence($this->start);
if (strpos($rrule, '=') !== false) {
$this->recurrence->fromRRule20($rrule);
} else {
$this->recurrence->fromRRule10($rrule);
}
// Exceptions. EXDATE represents deleted events, just add the
// exception, no new event is needed.
$exdates = $vEvent->getAttributeValues('EXDATE');
if (is_array($exdates)) {
foreach ($exdates as $exdate) {
if (is_array($exdate)) {
$this->recurrence->addException((int) $exdate['year'], (int) $exdate['month'], (int) $exdate['mday']);
}
}
}
}
} catch (Horde_Icalendar_Exception $e) {
}
}
示例2: _handlevEventRecurrence
/**
* Handle parsing recurrence related fields.
*
* @param Horde_Icalendar $vEvent
* @throws Kronolith_Exception
*/
protected function _handlevEventRecurrence($vEvent)
{
// Recurrence.
try {
$rrule = $vEvent->getAttribute('RRULE');
if (!is_array($rrule)) {
$this->recurrence = new Horde_Date_Recurrence($this->start);
if (strpos($rrule, '=') !== false) {
$this->recurrence->fromRRule20($rrule);
} else {
$this->recurrence->fromRRule10($rrule);
}
/* Delete all existing exceptions to this event if it
* already exists */
if (!empty($this->uid)) {
$kronolith_driver = Kronolith::getDriver(null, $this->calendar);
$search = new StdClass();
$search->start = $this->recurrence->getRecurStart();
$search->end = $this->recurrence->getRecurEnd();
$search->baseid = $this->uid;
$results = $kronolith_driver->search($search);
foreach ($results as $days) {
foreach ($days as $exception) {
$kronolith_driver->deleteEvent($exception->id);
}
}
}
// Exceptions. EXDATE represents deleted events, just add the
// exception, no new event is needed.
$exdates = $vEvent->getAttributeValues('EXDATE');
if (is_array($exdates)) {
foreach ($exdates as $exdate) {
if (is_array($exdate)) {
$this->recurrence->addException((int) $exdate['year'], (int) $exdate['month'], (int) $exdate['mday']);
}
}
}
}
} catch (Horde_Icalendar_Exception $e) {
}
// RECURRENCE-ID indicates that this event represents an exception
try {
$recurrenceid = $vEvent->getAttribute('RECURRENCE-ID');
$kronolith_driver = Kronolith::getDriver(null, $this->calendar);
$originaldt = new Horde_Date($recurrenceid);
$this->exceptionoriginaldate = $originaldt;
$this->baseid = $this->uid;
$this->uid = null;
try {
$originalEvent = $kronolith_driver->getByUID($this->baseid);
$originalEvent->recurrence->addException($originaldt->format('Y'), $originaldt->format('m'), $originaldt->format('d'));
$originalEvent->save();
} catch (Horde_Exception_NotFound $e) {
throw new Kronolith_Exception(_("Unable to locate original event series."));
}
} catch (Horde_Icalendar_Exception $e) {
}
}
示例3: _handlevEventRecurrence
/**
* Handle parsing recurrence related fields.
*
* @param Horde_Icalendar $vEvent
* @throws Kronolith_Exception
*/
protected function _handlevEventRecurrence($vEvent)
{
// Recurrence.
try {
$rrule = $vEvent->getAttribute('RRULE');
if (!is_array($rrule)) {
$this->recurrence = new Horde_Date_Recurrence($this->start);
if (strpos($rrule, '=') !== false) {
$this->recurrence->fromRRule20($rrule);
} else {
$this->recurrence->fromRRule10($rrule);
}
// Exceptions. EXDATE represents deleted events, just add the
// exception, no new event is needed.
$exdates = $vEvent->getAttributeValues('EXDATE');
if (is_array($exdates)) {
foreach ($exdates as $exdate) {
if (is_array($exdate)) {
$this->recurrence->addException((int) $exdate['year'], (int) $exdate['month'], (int) $exdate['mday']);
}
}
}
}
} catch (Horde_Icalendar_Exception $e) {
}
// RECURRENCE-ID indicates that this event represents an exception
try {
$this->recurrenceid = $vEvent->getAttribute('RECURRENCE-ID');
$originaldt = new Horde_Date($this->recurrenceid);
$this->exceptionoriginaldate = $originaldt;
$this->baseid = $this->uid;
$this->uid = null;
try {
$originalEvent = $this->getDriver()->getByUID($this->baseid);
$originalEvent->recurrence->addException($originaldt->format('Y'), $originaldt->format('m'), $originaldt->format('d'));
$originalEvent->save();
} catch (Horde_Exception_NotFound $e) {
throw new Kronolith_Exception(_("Unable to locate original event series."));
}
} catch (Horde_Icalendar_Exception $e) {
}
}