Question

I have been struggling with the php api for Google Calendar for weeks now. I have already managed to add and read events with the api and now I'm trying to get Extended Properies to work. I have tried two different ways of adding them to my events:
1:

$extProp = New Google_EventExtendedProperties('test', 'test');
$event->setExtendedProperty($extProps);

2:

$extProp = New Google_EventExtendedProperties('test', 'test');
$event->ExtendedProperty = $extProps;

Both don't give me errors, but I'm not sure if it's working. I tried to read the events with the get method as well as with the list method wich are both described in the documentation of the api, but I can't get my extended properties.

Does anyone know how extended properties work with php?

Was it helpful?

Solution

I finally managed to do it. I used the following code:

$extendedProperties = New Google_EventExtendedProperties();
$extendedProperties->setShared(array('custom'=>'blalblabla'));
$event->setExtendedProperties($extendedProperties); 

OTHER TIPS

$extendedProperties = New Google_EventExtendedProperties();

should be changed to:

$extendedProperties = new Google_Service_Calendar_EventExtendedProperties();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top