I am trying to add multiple phone numbers to a contact that I am creating with Php-Ews. There is no documentation on adding multiple numbers to a contact. Can someone help me find out how to accomplish this?
here is what I have:
// create a phone number
$phone = new Type\PhoneNumberDictionaryEntryType();
$phone->Key = new Type\PhoneNumberKeyType();
$phone->Key->_ = Type\PhoneNumberKeyType::HOME_PHONE;
$phone->_ = $info['phone'];
// create a phone number
$phone2 = new Type\PhoneNumberDictionaryEntryType();
$phone2->Key = new Type\PhoneNumberKeyType();
$phone2->Key->_ = Type\PhoneNumberKeyType::COMPANY_MAIN_PHONE;
$phone2->_ = $info['phone'];
// set the phone number
$contact->PhoneNumbers = new Type\PhoneNumberDictionaryType();
$contact->PhoneNumbers->Entry[] = $phone;
$contact->PhoneNumbers->Entry[] = $phone2;
It looked to me like the Entry[]
is an array. Therefore I thought I would be able to add as many as I would like as seen above. However when I do this I get the The request failed schema validation: The required attribute 'Key' is missing.
error. I figured I had to add a key to the []
but I was unable to find out what that is.