/**
* Retrieve the busy times from this event within the given timeframe. This
* is trivial for non-recurring events but recurring events need to be
* expanded.
*
* @param Horde_Date $startDate The start point.
* @param Horde_Date $endDate The end point.
*
* @return array The list of busy times (only the start times of the event).
*/
public function getBusyTimes(Horde_Date $startDate, Horde_Date $endDate)
{
if (!$this->recurs()) {
if ($startDate->compareDateTime($this->_start) > 0 || $endDate->compareDateTime($this->_start) < 0) {
return array();
}
return array($this->_start->timestamp());
} else {
$result = array();
$next = $this->_recurrence->nextRecurrence($startDate);
while ($next) {
if ($endDate->compareDateTime($next) < 0) {
break;
}
if (!$this->_recurrence->hasException($next->year, $next->month, $next->mday)) {
$result[] = $next->timestamp();
}
$next->mday++;
$next = $this->_recurrence->nextRecurrence($next);
}
return $result;
}
}