Is it possible to set multiple custom properties on a calendar item using PHP EWS? I haven't been able to find any documentation on this except this example of retrieving extended properties. I was able to get it working for a single field, but I'm wondering if you can set multiple custom properties. The API seems to allude to that possibility.
For example, the following properties are defined in ExtendedPropertyType.php:
class EWSType_ExtendedPropertyType extends EWSType
{
/**
* ExtendedFieldURI property
*
* @var EWSType_PathToExtendedFieldType
*/
public $ExtendedFieldURI;
/**
* Value property
*
* @var string
*/
public $Value;
/**
* Values property
*
* @var EWSType_NonEmptyArrayOfPropertyValuesType
*/
public $Values;
}
The $Values
property appears to be an array, but I was never able to store anything there successfully. My workaround was to collapse an array of values into a JSON string and store it in the $Value
property (see my answer below). That works, but it feels a little hackish. Is there a better way?
Here's my workaround in the mean time (just the pertinent pieces). Store multiple values as a JSON string in the
$Value
property:Set the property when saving the calendar item:
Retrieve the property when reading the calendar:
Decode the JSON for each calendar item in the response:
This works for me. print_r looks like this: