Skip to content

Commit

Permalink
Fixed a small possible bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Garethp committed Sep 28, 2015
1 parent 52a0b60 commit e7f3ffa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 0.5.7 - 2015-09-28
* Allows the parentFolder in getFolderByDisplayName to be a folderId or a string

## 0.5.6 - 2015-09-28
* Added simple support for creating folders
* Added simple support for moving items
Expand Down
10 changes: 7 additions & 3 deletions src/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,19 +328,23 @@ public function getFolderByFolderId($folderId)

/**
* @param $folderName
* @param string $parentFolder
* @param string|Type\FolderIdType $parentFolderId
* @param array $options
* @return bool|Type\BaseFolderType
*/
public function getFolderByDisplayName($folderName, $parentFolder = 'root', $options = array())
public function getFolderByDisplayName($folderName, $parentFolderId = 'root', $options = array())
{
if (is_string($parentFolderId)) {
$parentFolderId = $this->getFolderByDistinguishedId($parentFolderId)->getFolderId();
}

$request = array(
'Traversal' => 'Shallow',
'FolderShape' => array(
'BaseShape' => 'AllProperties'
),
'ParentFolderIds' => array(
'DistinguishedFolderId' => array('Id'=>$parentFolder)
'FolderId' => $parentFolderId->toArray()
)
);

Expand Down

0 comments on commit e7f3ffa

Please sign in to comment.