Skip to content

Commit

Permalink
Slight change to merged PR and updating Changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
Garethp committed May 4, 2017
1 parent bf74ca2 commit ea24b88
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Changelog

## 0.9.2 - TBD
## 0.9.2 - 2017-05-04
* Added `API::emptyFolder(Type\FolderIdType $folderId, $deleteType = 'SoftDelete', $deleteSubFolders = false, array $options = [])`
* Added `MailAPI::emptyTrash(array $options = [])`
* Added `CalendarAPI::getAvailabilityFor($startTime, $endTime, array $users, array $options = [])`
* Added `CalendarAPI::areAvailable($startTime, $endTime, $period, array $users, array $options = [])`
* Exchange Exceptions now contain the response in `ExchangeException::getResponse()`
* Added `ContactsAPI::pickCalendarFolder($displayName)`
* Added `API::createContactsFolder($names, FolderIdType $parentFolder, $options = [])`

## 0.9.1 - 2016-11-28
* Changed the default ItemShape of `listChanges` to `AllProperties`
Expand Down
8 changes: 6 additions & 2 deletions src/ContactsAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace garethp\ews;

use garethp\ews\API\Exception;
use garethp\ews\API\Type;

class ContactsAPI extends API
Expand All @@ -16,17 +17,20 @@ class ContactsAPI extends API
*
* @param string|null $displayName
* @return $this
* @throws Exception
*/
public function pickContact($displayName = null)
public function pickContactsFolder($displayName = null)
{
if ($displayName == 'default.contacts' || $displayName == null) {
$folder = $this->getFolderByDistinguishedId('contacts');
} else {
$folder = $this->getFolderByDisplayName($displayName, 'contacts');
}

if (!$folder) {
return false;
throw new Exception('Folder does not exist');
}

$this->folderId = $folder->getFolderId();
return $this;
}
Expand Down

0 comments on commit ea24b88

Please sign in to comment.