예제 #1
0
<?php

use garethp\ews\ContactsAPI as API;
use garethp\ews\API\Enumeration;
$api = API::withUsernameAndPassword('server', 'username', 'password');
$api->createContacts(array('GivenName' => 'John', 'Surname' => 'Smith', 'EmailAddresses' => array('Entry' => array('Key' => Enumeration\EmailAddressKeyType::EMAIL_ADDRESS_1, '_value' => '*****@*****.**')), 'PhoneNumbers' => array('Entry' => array(array('Key' => Enumeration\PhoneNumberKeyType::HOME_PHONE, '_value' => '000'), array('Key' => Enumeration\PhoneNumberKeyType::BUSINESS_PHONE, '_value' => '111'))), 'PhysicalAddresses' => array('Entry' => array('Key' => Enumeration\PhysicalAddressKeyType::HOME, 'street' => '123 Street', 'city' => '123 City', 'state' => '123 State', 'countryOrRegion' => '123 Country', 'postalCode' => '12345'))));
예제 #2
0
<?php

use garethp\ews\ContactsAPI as API;
$api = API::withUsernameAndPassword('server', 'username', 'password', ['drillDownResponses' => false]);
$firstPage = $api->getContacts();
foreach ($firstPage as $contacts) {
    //Work with the first page of contacts here
}
$secondPage = $api->getNextPage($firstPage);
foreach ($secondPage as $contacts) {
    //Work with the second page of contacts here
}
$folders = $api->getChildrenFolders('test');
foreach ($folders as $folder) {
    //Work with folders this way
}
$moreFolders = $api->getNextPage($folders);
foreach ($moreFolders as $folder) {
    //More folders here
}