### Start Documentation Preview Source: https://github.com/markuspoerschke/ical/blob/2.x/CONTRIBUTING.md Navigate to the website directory and start a local server to preview the documentation. ```bash cd website make start ``` -------------------------------- ### Install Dependencies Source: https://github.com/markuspoerschke/ical/blob/2.x/website/README.md Installs project dependencies using Yarn. ```console yarn install ``` -------------------------------- ### Install eluceo/ical Package Source: https://github.com/markuspoerschke/ical/blob/2.x/README.md Install the package using Composer by running the following command. ```sh composer require eluceo/ical ``` -------------------------------- ### Start Local Development Server Source: https://github.com/markuspoerschke/ical/blob/2.x/website/README.md Starts a local development server that automatically refreshes on changes. Opens the site in a browser. ```console yarn start ``` -------------------------------- ### Full Example: Create and Output a Single Day Event Source: https://github.com/markuspoerschke/ical/blob/2.x/README.md This example creates a single-day event with a summary and description, then outputs it as an iCalendar file via HTTP headers. Ensure you have the autoloader included. ```PHP setSummary('Christmas Eve') ->setDescription('Lorem Ipsum Dolor...') ->setOccurrence( new Eluceo\iCal\Domain\ValueObject\SingleDay( new Eluceo\iCal\Domain\ValueObject\Date( \DateTimeImmutable::createFromFormat('Y-m-d', '2030-12-24') ) ) ); // 2. Create Calendar domain entity $calendar = new Eluceo\iCal\Domain\Entity\Calendar([$event]); // 3. Transform domain entity into an iCalendar component $componentFactory = new Eluceo\iCal\Presentation\Factory\CalendarFactory(); $calendarComponent = $componentFactory->createCalendar($calendar); // 4. Set headers header('Content-Type: text/calendar; charset=utf-8'); header('Content-Disposition: attachment; filename="cal.ics"'); // 5. Output echo $calendarComponent; ``` -------------------------------- ### Generate a basic .ics file with one event Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/index.md This snippet demonstrates the minimal setup required to create a calendar file with a single event. Ensure the necessary classes are imported before execution. ```php setSummary('Christmas Eve') ->setOccurrence( new SingleDay( new Date(DateTimeImmutable::createFromFormat('Y-m-d', '2030-12-24')) ) ); // 2. Create Calendar domain entity $calendar = new Calendar([$event]); // 3. Transform domain entity into an iCalendar component $componentFactory = new CalendarFactory(); $calendarComponent = $componentFactory->createCalendar($calendar); // 4. Set HTTP headers header('Content-Type: text/calendar; charset=utf-8'); header('Content-Disposition: attachment; filename="cal.ics"'); // 5. Output echo $calendarComponent; ``` -------------------------------- ### Create and Render iCal Event (v0.16.*) Source: https://github.com/markuspoerschke/ical/blob/2.x/UPGRADE.md Example of creating an iCal event and rendering it directly in version 0.16.*. This version allowed direct output of the calendar component. ```php $vEvent = new \Eluceo\iCal\Component\Event(); $vEvent ->setDtStart(new \DateTime('2012-12-24')) ->setDtEnd(new \DateTime('2012-12-24')) ->setNoTime(true) ->setSummary('Christmas') ; $vCalendar = new \Eluceo\iCal\Component\Calendar('www.example.com'); $vCalendar->addComponent($vEvent); header('Content-Type: text/calendar; charset=utf-8'); header('Content-Disposition: attachment; filename="cal.ics"'); echo $vCalendar->render(); ``` -------------------------------- ### Install eluceo/ical via Composer CLI Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/installation.md Use this command to add the eluceo/ical package to your project dependencies via the Composer command line. ```sh composer require eluceo/ical ``` -------------------------------- ### Define Custom Event Entity Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/custom-properties.md Extend the base Event class to include custom properties. This example adds a read-only string property. ```php namespace Documentation; use Eluceo\iCal\Domain\Entity\Event; class CustomEvent extends Event { private string $myCustomProperty = 'foo bar baz!'; public function getMyCustomProperty(): string { return $this->myCustomProperty; } } ``` -------------------------------- ### Create TimeSpan Event Occurrence Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-event.md Use `TimeSpan` for events with specific start and end times. The constructor takes `DateTime` objects for the start and end of the event. ```php use Eluceo\iCal\Domain\ValueObject\TimeSpan; use Eluceo\iCal\Domain\ValueObject\DateTime; use Eluceo\iCal\Domain\Entity\Event; $start = new DateTime(DateTimeImmutable::createFromFormat('Y-m-d H:i:s', '2020-01-03 13:00:00'), false); $end = new DateTime(DateTimeImmutable::createFromFormat('Y-m-d H:i:s', '2020-01-03 14:00:00'), false); $occurrence = new TimeSpan($start, $end); $event = new Event(); $event->setOccurrence($occurrence); ``` -------------------------------- ### Build Static Website Source: https://github.com/markuspoerschke/ical/blob/2.x/website/README.md Generates the static content for the website into the 'build' directory. ```console yarn build ``` -------------------------------- ### Deploy to GitHub Pages Source: https://github.com/markuspoerschke/ical/blob/2.x/website/README.md Builds the website and deploys it to the 'gh-pages' branch, suitable for GitHub Pages hosting. Requires setting GIT_USER. ```console GIT_USER= USE_SSH=true yarn deploy ``` -------------------------------- ### Instantiate Custom Event and Calendar Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/custom-properties.md Create a new instance of the custom event and add it to a calendar. This sets up the event with a summary before it's processed by the factory. ```php $event = new CustomEvent(); $event->setSummary('This is a test event'); $calendar = new Calendar([$event]); ``` -------------------------------- ### Run Unit Tests Source: https://github.com/markuspoerschke/ical/blob/2.x/CONTRIBUTING.md Execute all unit tests for the project. Ensure tests are added to merge requests. ```bash make test ``` -------------------------------- ### Render iCal File Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/custom-properties.md Set the appropriate headers and echo the generated calendar component. This will output the iCal file with custom properties included. ```php header('Content-Type: text/calendar; charset=utf-8'); header('Content-Disposition: attachment; filename="cal.ics"'); echo $calendarComponent; ``` -------------------------------- ### Create New Event Instance Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-event.md Instantiate a new Event object. An optional unique identifier can be provided; otherwise, a random one is generated. ```php use Eluceo\iCal\Domain\Entity\Event; $event = new Event(); ``` -------------------------------- ### Create a Calendar Domain Entity with an Event Source: https://github.com/markuspoerschke/ical/blob/2.x/README.md This snippet demonstrates creating a calendar domain entity and adding an event to it. ```PHP $calendar = new \Eluceo\iCal\Domain\Entity\Calendar([$event]); ``` -------------------------------- ### Set Event Properties with Fluent Interface Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-event.md Configure event properties such as summary, description, and occurrence using a fluent interface for cleaner code. ```php use Eluceo\iCal\Domain\Entity\Event; use Eluceo\iCal\Domain\ValueObject\Date; use Eluceo\iCal\Domain\ValueObject\SingleDay; $event = (new Event()) ->setSummary('Lunch Meeting') ->setDescription('Lorem Ipsum...') ->setOccurrence(new SingleDay(new Date())); ``` -------------------------------- ### Set Event Summary Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-event.md Assign a short, single-line text to describe the event using the `setSummary` method. ```php use Eluceo\iCal\Domain\Entity\Event; $event = new Event(); $event->setSummary('Lunch Meeting'); ``` -------------------------------- ### Create an Empty Event Domain Entity Source: https://github.com/markuspoerschke/ical/blob/2.x/README.md This snippet shows how to create a basic event domain entity. ```PHP $event = new \Eluceo\iCal\Domain\Entity\Event(); ``` -------------------------------- ### Check Code Style (Prettier) Source: https://github.com/markuspoerschke/ical/blob/2.x/CONTRIBUTING.md Manually check the code style for non-PHP files using Prettier. ```bash make test-prettier ``` -------------------------------- ### Add Event Attachments Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-event.md Associate documents with an event using `Attachment`. Attachments can be specified via URI or as binary content. ```php use Eluceo\iCal\Domain\Entity\Event; use Eluceo\iCal\Domain\ValueObject\Attachment; use Eluceo\iCal\Domain\ValueObject\BinaryContent; use Eluceo\iCal\Domain\ValueObject\Uri; $urlAttachment = new Attachment( new Uri('https://example.com/test.txt'), 'text/plain' ); $binaryContentAttachment = new Attachment( new BinaryContent(file_get_contents('test.txt')), 'text/plain' ); $event = new Event(); $event->addAttachment($urlAttachment); $event->addAttachment($binaryContentAttachment); ``` -------------------------------- ### Set Event Description Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-event.md Provide additional, more detailed information about the event using the `setDescription` method. ```php use Eluceo\iCal\Domain\Entity\Event; $event = new Event(); $event->setDescription('Lorem Ipsum Dolor...'); ``` -------------------------------- ### Configure Calendar Factory with Custom Factory Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/custom-properties.md Pass an instance of the custom event factory to the main calendar factory. This ensures that custom properties are included when the calendar is rendered. ```php $calendarComponentFactory = new CalendarFactory(new CustomEventFactory()); $calendarComponent = $calendarComponentFactory->createCalendar($calendar); ``` -------------------------------- ### Create Event with Custom Unique Identifier Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-event.md Initialize an Event object with a specific unique identifier, ensuring global uniqueness by including a domain name. ```php use Eluceo\iCal\Domain\Entity\Event; use Eluceo\iCal\Domain\ValueObject\UniqueIdentifier; $myEventUid = 'example.com/event/1234'; $uniqueIdentifier = new UniqueIdentifier($myEventUid); $event = new Event($uniqueIdentifier); ``` -------------------------------- ### Add Events via Named Constructor Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-calendar.md Use this method to initialize a Calendar object with an array of Event objects. ```php use Eluceo\iCal\Domain\Entity\Calendar; use Eluceo\iCal\Domain\Entity\Event; $events = [ new Event(), new Event(), ]; $calendar = new Calendar($events); ``` -------------------------------- ### Upgrade iCal Event Creation to v2.0 Source: https://github.com/markuspoerschke/ical/blob/2.x/UPGRADE.md Demonstrates the updated process for creating an iCal event in version 2.0. This involves creating domain entities first, then using a factory to create the iCalendar component for output. ```php // 1. Create Event domain entity $event = (new Eluceo\iCal\Domain\Entity\Event()) ->setSummary('Christmas Eve') ->setDescription('Lorem Ipsum Dolor...') ->setOccurrence( new Eluceo\iCal\Domain\ValueObject\SingleDay( new Eluceo\iCal\Domain\ValueObject\Date( \DateTimeImmutable::createFromFormat('Y-m-d', '2012-12-24') ) ) ); // 2. Create Calendar domain entity $calendar = new Eluceo\iCal\Domain\Entity\Calendar([$event]); // 3. Transform domain entity into an iCalendar component $componentFactory = new Eluceo\iCal\Presentation\Factory\CalendarFactory(); $calendarComponent = $componentFactory->createCalendar($calendar); // 4. Set headers header('Content-Type: text/calendar; charset=utf-8'); header('Content-Disposition: attachment; filename="cal.ics"'); // 5. Output echo $calendarComponent; ``` -------------------------------- ### Set Event Location Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-event.md Define the event's location using the `Location` object. Optionally include a title and geographic coordinates. ```php use Eluceo\iCal\Domain\Entity\Event; use Eluceo\iCal\Domain\ValueObject\Location; use Eluceo\iCal\Domain\ValueObject\GeographicPosition; $location = new Location('Neuschwansteinstraße 20, 87645 Schwangau'); // optionally you can create a location with a title for X-APPLE-STRUCTURED-LOCATION attribute $location = new Location('Neuschwansteinstraße 20, 87645 Schwangau', 'Schloss Neuschwanstein'); // optionally a location with a geographical position can be created $location = $location->withGeographicPosition(new GeographicPosition(47.557579, 10.749704)); $event = new Event(); $event->setLocation($location); ``` -------------------------------- ### Set Event Organizer Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-event.md Specify the event organizer using the `Organizer` object. This includes an email address and optionally a display name, directory entry, and sender email. ```php use Eluceo\iCal\Domain\ValueObject\Organizer; use Eluceo\iCal\Domain\ValueObject\Uri; use Eluceo\iCal\Domain\ValueObject\EmailAddress; use Eluceo\iCal\Domain\Entity\Event; $organizer = new Organizer( new EmailAddress('test@example.org'), 'John Doe', new Uri('ldap://example.com:6666/o=ABC%20Industries,c=US???(cn=Jim%20Dolittle)'), new EmailAddress('sender@example.com') ); $event = new Event(); $event->setOrganizer($organizer); ``` -------------------------------- ### Save iCalendar Component to File Source: https://github.com/markuspoerschke/ical/blob/2.x/README.md This snippet demonstrates how to save the generated iCalendar component to a file. ```PHP file_put_contents('calendar.ics', (string) $iCalendarComponent); ``` -------------------------------- ### Add Attendee to Event Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-event.md Defines an attendee with various properties and adds them to an event. Requires importing Attendee, EmailAddress, and other relevant enums/value objects. ```php use Eluceo\iCal\Domain\Entity\Event; use Eluceo\iCal\Domain\Enum\ParticipationStatus; use Eluceo\iCal\Domain\Enum\RoleType; USE Eluceo\iCal\Domain\Enum\CalendarUserType; use Eluceo\iCal\Domain\Entity\Attendee; use Eluceo\iCal\Domain\ValueObject\EmailAddress; use Eluceo\iCal\Domain\ValueObject\BinaryContent; use Eluceo\iCal\Domain\ValueObject\Uri; $attendee = new Attendee(new EmailAddress('jdoe@example.com')); $attendee->setCalendarUserType(CalendarUserType::INDIVIDUAL()) ->addMember(new Member(new EmailAddress('test@example.com'))) ->setRole(RoleType::CHAIR()) ->setParticipationStatus( ParticipationStatus::NEEDS_ACTION() )->setResponseNeededFromAttendee(true) ->addDelegatedTo( new EmailAddress('jdoe@example.com') )->addDelegatedTo( new EmailAddress('jqpublic@example.com') )->addDelegatedFrom( new EmailAddress('jsmith@example.com') )->addSentBy( new EmailAddress('sray@example.com') ) ->setDisplayName('Test Example') ->setDirectoryEntryReference( new Uri('ldap://example.com:6666/o=ABC%20Industries,c=US???(cn=Jim%20Dolittle)') )->setLanguage('en-US'); $event = (new Event()) ->addAttendee($attendee); ``` ```php $event = new Event(); $event->addAttachment($urlAttachment); $event->addAttachment($binaryContentAttachment); ``` -------------------------------- ### Set Event URL Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-event.md Link to an arbitrary resource related to the event by setting a URL using the `setUrl` method. ```php use Eluceo\iCal\Domain\Entity\Event; use Eluceo\iCal\Domain\ValueObject\Uri; $event = new Event(); $uri = new Uri("https://example.org/calendarevent"); $event->setUrl($uri); ``` -------------------------------- ### Add eluceo/ical to composer.json Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/installation.md Alternatively, specify the eluceo/ical package and its version constraint directly within your composer.json file. ```json { "require": { "eluceo/ical": "^2" } } ``` -------------------------------- ### Create TimeZone with Date Range from PHP DateTimeZone Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-timezone.md This method allows creating a `TimeZone` object from a PHP `DateTimeZone` while specifying the lowest and highest dates for transitions. This helps reduce the output size in the generated iCal file. Both `Eluceo\iCal\Domain\Entity\TimeZone` and `DateTimeZone` classes must be imported. ```php use Eluceo\iCal\Domain\Entity\TimeZone; use DateTimeZone as PhpDateTimeZone; $phpDateTimeZone = new PhpDateTimeZone('Europe/Berlin'); $timeZone = TimeZone::createFromPhpDateTimeZone( $phpDateTimeZone, new DateTimeImmutable('2019-05-01 15:00:00', $phpDateTimeZone), new DateTimeImmutable('2020-12-24 18:00:00', $phpDateTimeZone), ); ``` -------------------------------- ### Add Events via Generator Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-calendar.md Provide a generator function to the Calendar constructor to dynamically create and add events. ```php use Eluceo\iCal\Domain\Entity\Calendar; use Eluceo\iCal\Domain\Entity\Event; $eventGenerator = function(): Generator { yield new Event(); yield new Event(); }; $calendar = new Calendar($eventGenerator()); ``` -------------------------------- ### Add Events via addEvent Method Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-calendar.md Call the addEvent method repeatedly to add individual Event objects to an existing Calendar object. ```php use Eluceo\iCal\Domain\Entity\Calendar; use Eluceo\iCal\Domain\Entity\Event; $calendar = new Calendar(); $calendar ->addEvent(new Event()) ->addEvent(new Event()); ``` -------------------------------- ### Send iCalendar Component via HTTP Source: https://github.com/markuspoerschke/ical/blob/2.x/README.md This snippet shows how to send the generated iCalendar component as an HTTP response. ```PHP header('Content-Type: text/calendar; charset=utf-8'); header('Content-Disposition: attachment; filename="cal.ics"'); echo $iCalendarComponent; ``` -------------------------------- ### Create Timestamp from DateTimeInterface Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-event.md Create a Timestamp object from any object implementing the `\DateTimeInterface`, such as `DateTimeImmutable`. ```php use Eluceo\iCal\Domain\Entity\Event; use Eluceo\iCal\Domain\ValueObject\Timestamp; $event = new Event(); $dateTime = DateTimeImmutable::createFromFormat('Y-m-d', '2019-12-24'); $timestamp = new Timestamp($dateTime); $event->touch($timestamp); ``` -------------------------------- ### Add Categories to Event Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-event.md Assigns categories to a calendar event. Requires importing Event and Category value objects. ```php use Eluceo\iCal\Domain\Entity\Event; use Eluceo\iCal\Domain\ValueObject\Category; $event = new Event(); $event ->addCategory(new Category('APPOINTMENT')) ->addCategory(new Category('EDUCATION')); ``` -------------------------------- ### Set Event Status Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-event.md Sets the status of an event, such as confirmed or cancelled. Requires importing Event and EventStatus enum. ```php use Eluceo\iCal\Domain\Entity\Event; use Eluceo\iCal\Domain\Enum\EventStatus; $event = new Event(); $event->setStatus(EventStatus::CANCELLED()); ``` -------------------------------- ### Create Multi-Day Event Occurrence Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-event.md Use `MultiDay` to define an event spanning multiple consecutive days. The constructor accepts the first and last inclusive days of the event. ```php use Eluceo\iCal\Domain\ValueObject\MultiDay; use Eluceo\iCal\Domain\ValueObject\Date; use Eluceo\iCal\Domain\Entity\Event; $firstDay = new Date(DateTimeImmutable::createFromFormat('Y-m-d', '2019-12-24')); $lastDay = new Date(DateTimeImmutable::createFromFormat('Y-m-d', '2019-12-26')); $occurrence = new MultiDay($firstDay, $lastDay); $event = new Event(); $event->setOccurrence($occurrence); ``` -------------------------------- ### Create TimeZone from PHP DateTimeZone Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-timezone.md Use this method to automatically convert PHP's `DateTimeZone` objects into the iCal library's `TimeZone` domain object. Ensure the `Eluceo\iCal\Domain\Entity\TimeZone` and `DateTimeZone` classes are imported. ```php use Eluceo\iCal\Domain\Entity\TimeZone; use DateTimeZone as PhpDateTimeZone; $timeZone = TimeZone::createFromPhpDateTimeZone(new PhpDateTimeZone('Europe/Berlin')); ``` -------------------------------- ### Transform Calendar Domain Object to iCalendar Component Source: https://github.com/markuspoerschke/ical/blob/2.x/README.md This snippet shows how to transform a calendar domain object into a presentation object for iCalendar. ```PHP $iCalendarComponent = (new \Eluceo\iCal\Presentation\Factory\CalendarFactory())->createCalendar($calendar); ``` -------------------------------- ### Set Published TTL for Calendar Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/non-standard-properties.md Use the setPublishedTTL() method with a DateInterval object to specify the download frequency for iCalendar files. The duration should be in ISO 8601 format. ```php use Eluceo\iCal\Domain\Entity\Calendar; $calendar = new Calendar(); // set the duration to 2 hours $calendar->setPublishedTTL(new DateInterval('PT2H')) ``` -------------------------------- ### Create Custom Event Factory Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/custom-properties.md Extend the EventFactory to add custom properties to the iCal component. This factory reads the custom property from the event and adds it as an 'X-CUSTOM' property. ```php namespace Documentation; use Eluceo\iCal\Domain\Entity\Event; use Eluceo\iCal\Presentation\Component; use Eluceo\iCal\Presentation\Component\Property; use Eluceo\iCal\Presentation\Component\Property\Value\TextValue; use Eluceo\iCal\Presentation\Factory\EventFactory; class CustomEventFactory extends EventFactory { public function createComponent(Event $event): Component { $component = parent::createComponent($event); if ($event instanceof CustomEvent) { $component = $component->withProperty( new Property( 'X-CUSTOM', new TextValue($event->getMyCustomProperty()) ) ); } return $component; } } ``` -------------------------------- ### Fix Code Style (PHP-CS-Fixer) Source: https://github.com/markuspoerschke/ical/blob/2.x/CONTRIBUTING.md Fix or check the code style for PHP files using the PHP Coding Standards Fixer. ```bash make fix ``` -------------------------------- ### Add Time Zones to Calendar Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-calendar.md When working with local times, add time zone definitions to the Calendar object using TimeZone::createFromPhpDateTimeZone. ```php use Eluceo\iCal\Domain\Entity\Calendar; use Eluceo\iCal\Domain\Entity\TimeZone; use DateTimeZone as PhpDateTimeZone; $calendar = new Calendar(); $calendar ->addTimeZone(TimeZone::createFromPhpDateTimeZone(new PhpDateTimeZone('Europe/Berlin'))) ->addTimeZone(TimeZone::createFromPhpDateTimeZone(new PhpDateTimeZone('Europe/London'))) ; ``` -------------------------------- ### Set Single Day Occurrence Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-event.md Define an event that occurs all day on a specific date. Requires a `Date` object, which can be created from a `DateTimeInterface`. ```php use Eluceo\iCal\Domain\ValueObject\SingleDay; use Eluceo\iCal\Domain\ValueObject\Date; use Eluceo\iCal\Domain\Entity\Event; $date = new Date(DateTimeImmutable::createFromFormat('Y-m-d', '2019-12-24')); $occurrence = new SingleDay($date); $event = new Event(); $event->setOccurrence($occurrence); ``` -------------------------------- ### Update Event Timestamp Source: https://github.com/markuspoerschke/ical/blob/2.x/website/docs/component-event.md Modify the `$touchedAt` property of an event using the `touch` method with a new Timestamp object. ```php use Eluceo\iCal\Domain\ValueObject\Timestamp; use Eluceo\iCal\Domain\Entity\Event; $event = new Event(); $event->touch(new Timestamp()); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.