Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,33 @@ public function disconnect() {
* @throws FolderFetchingException
*/
public function getFolder($folder_name) {
return $this->getFolderByName($folder_name);
}

/**
* Get a folder instance by a folder name
* @param $folder_name
*
* @return mixed
* @throws ConnectionFailedException
* @throws FolderFetchingException
*/
public function getFolderByName($folder_name) {
return $this->getFolders(false)->where("name", $folder_name)->first();
}

/**
* Get a folder instance by a folder path
* @param $folder_path
*
* @return mixed
* @throws ConnectionFailedException
* @throws FolderFetchingException
*/
public function getFolderByPath($folder_path) {
return $this->getFolders(false)->where("path", $folder_path)->first();
}

/**
* Get folders list.
* If hierarchical order is set to true, it will make a tree of folders, otherwise it will return flat array.
Expand Down