setTimestamp($this->timeFactory->getTime()); * $inTwoWeeks = $dateTime->add(new DateInterval('P14D')); * * $calendar->search( * '', * [], * ['timerange' => ['start' => $dateTime, 'end' => $inTwoWeeks]], * 7 * ); * * Note: When combining timerange and limit, it's possible that the expected outcome is not in the order you would expect. * * Example: Create 7 events for tomorrow, starting from 11:00, 30 minutes each. Then create an 8th event for tomorrow at 10:00. * The above code will list the event at 11:00 first, missing the event at 10:00. The reason is the ordering by the primary key * and expanding on the backend level. This is a technical limitation. The easiest workaround is to fetch more events * than you actually need, with the downside of needing more resources. * * Related: * - https://github.com/nextcloud/server/pull/45222 * - https://github.com/nextcloud/server/issues/53002 * * 2) Find all events where the location property contains the string 'Berlin': * * $calendar->search( * 'Berlin', * ['LOCATION'] * ); * * @since 13.0.0 */ public function search(string $pattern, array $searchProperties = [], array $options = [], ?int $limit = null, ?int $offset = null): array; /** * @return int build up using {@see \OCP\Constants} * @since 13.0.0 */ public function getPermissions(): int; /** * Indicates whether the calendar is in the trash bin * * @since 26.0.0 */ public function isDeleted(): bool; }