Skip to content

Set a calendar event with custom identifier, so that I can (later on) GET an event by the same identifier #256

@Lxxrxns

Description

@Lxxrxns

Hey there!

Thank you for this excellent PHP library!

I am trying to make a script that synchronizes a schedule I have in my MySQL database to an EWS.
To do this, I was hoping to set a unique field in the EWS event data that I can later select, i.e. a unique number that I can search for to then get the $itemId to update or delete the event later if necessary.

In the examples, I was only able to find code that selects the FIRST event ( $item = $calendar->getCalendarItems()[0] ) (or any other event if the position in the array is known), but my question is:

Is it possible to do something like:

$calendar->createCalendarItems(array(
    'uniqueIdentifier' => 'abc123',
    'Subject' => 'Test',
    'Start' => $start->format('c'),
    'End' => $end->format('c')
));

And then later on do something like:

getCalendarItems( WHERE uniqueIdentifier = "abc123" )

I could then get the $itemId (the EWS id of the event) and perform other actions such as updateCalendarItem() on that $itemId.

Ideally, the uniqueIdentifier is not visible (or at least not easily EDITABLE) in Outlook for the end user, because that would break the link between my database and the EWS. For example, using a unique code in the event subject is not an option, because this will (a) be very ugly in the user's Outlook and (b) be editable, which would make the EWS event unfindable later on.

Any help would be greatly appreciated.

Laurens

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions