36 if ($vObject->name !== $filters[
'name']) {
60 foreach ($filters as $filter) {
62 $isDefined = isset($parent->{$filter[
'name']});
64 if ($filter[
'is-not-defined']) {
77 if ($filter[
'time-range']) {
78 foreach ($parent->{$filter[
'name']} as $subComponent) {
79 if ($this->
validateTimeRange($subComponent, $filter[
'time-range'][
'start'], $filter[
'time-range'][
'end'])) {
86 if (!$filter[
'comp-filters'] && !$filter[
'prop-filters']) {
92 foreach ($parent->{$filter[
'name']} as $subComponent) {
129 foreach ($filters as $filter) {
131 $isDefined = isset($parent->{$filter[
'name']});
133 if ($filter[
'is-not-defined']) {
146 if ($filter[
'time-range']) {
147 foreach ($parent->{$filter[
'name']} as $subComponent) {
148 if ($this->
validateTimeRange($subComponent, $filter[
'time-range'][
'start'], $filter[
'time-range'][
'end'])) {
155 if (!$filter[
'param-filters'] && !$filter[
'text-match']) {
161 foreach ($parent->{$filter[
'name']} as $subComponent) {
165 (!$filter[
'text-match'] || $this->
validateTextMatch($subComponent, $filter[
'text-match']))
199 foreach ($filters as $filter) {
201 $isDefined = isset($parent[$filter[
'name']]);
203 if ($filter[
'is-not-defined']) {
216 if (!$filter[
'text-match']) {
222 foreach ($parent[$filter[
'name']]->getParts() as $paramPart) {
255 if ($check instanceof VObject\
Node) {
256 $check = $check->getValue();
261 return ($textMatch[
'negate-condition'] xor $isMatching);
285 switch ($component->name) {
291 return $component->isInTimeRange(
$start,
$end);
301 if ($component->parent->name ===
'VEVENT' && $component->parent->RRULE) {
305 while ($it->valid()) {
306 $expandedEvent = $it->getEventObject();
312 if ($expandedEvent->VALARM !== null) {
313 foreach ($expandedEvent->VALARM as $expandedAlarm) {
315 $effectiveTrigger = $expandedAlarm->getEffectiveTriggerTime();
316 if ($expandedAlarm->isInTimeRange(
$start,
$end)) {
320 if ((
string)$expandedAlarm->TRIGGER[
'VALUE'] ===
'DATE-TIME') {
330 if (!$firstAlarm || $effectiveTrigger < $firstAlarm) {
331 $firstAlarm = $effectiveTrigger;
336 if (is_null($firstAlarm)) {
344 if ($firstAlarm >
$end) {
351 return $component->isInTimeRange(
$start,
$end);
355 throw new \Sabre\DAV\Exception\NotImplemented(
'time-range filters are currently not supported on ' . $component->name .
' components');
363 case 'LAST-MODIFIED' :
364 return ($start <= $component->getDateTime() &&
$end >= $component->getDateTime());
369 throw new \Sabre\DAV\Exception\BadRequest(
'You cannot create a time-range filter on a ' . $component->name .
' component');
validateTimeRange(VObject\Node $component, $start, $end)
Validates if a component matches the given time range.
validateParamFilters(VObject\Property $parent, array $filters)
This method checks the validity of param-filters.
validateTextMatch($check, array $textMatch)
This method checks the validity of a text-match.
This class is used to determine new for a recurring event, when the next events occur.
static textMatch($haystack, $needle, $collation, $matchType='contains')
Checks if a needle occurs in a haystack ;)
validatePropFilters(VObject\Component $parent, array $filters)
This method checks the validity of prop-filters.
validate(VObject\Component\VCalendar $vObject, array $filters)
Verify if a list of filters applies to the calendar data object.
validateCompFilters(VObject\Component $parent, array $filters)
This method checks the validity of comp-filters.