Skip to content

Commit e7f3ffa

Browse files
committed
Fixed a small possible bug
1 parent 52a0b60 commit e7f3ffa

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## 0.5.7 - 2015-09-28
4+
* Allows the parentFolder in getFolderByDisplayName to be a folderId or a string
5+
36
## 0.5.6 - 2015-09-28
47
* Added simple support for creating folders
58
* Added simple support for moving items

src/API.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,19 +328,23 @@ public function getFolderByFolderId($folderId)
328328

329329
/**
330330
* @param $folderName
331-
* @param string $parentFolder
331+
* @param string|Type\FolderIdType $parentFolderId
332332
* @param array $options
333333
* @return bool|Type\BaseFolderType
334334
*/
335-
public function getFolderByDisplayName($folderName, $parentFolder = 'root', $options = array())
335+
public function getFolderByDisplayName($folderName, $parentFolderId = 'root', $options = array())
336336
{
337+
if (is_string($parentFolderId)) {
338+
$parentFolderId = $this->getFolderByDistinguishedId($parentFolderId)->getFolderId();
339+
}
340+
337341
$request = array(
338342
'Traversal' => 'Shallow',
339343
'FolderShape' => array(
340344
'BaseShape' => 'AllProperties'
341345
),
342346
'ParentFolderIds' => array(
343-
'DistinguishedFolderId' => array('Id'=>$parentFolder)
347+
'FolderId' => $parentFolderId->toArray()
344348
)
345349
);
346350

0 commit comments

Comments
 (0)