From 87b345ff0fb90fd09bcb9490f76c2ed758b95340 Mon Sep 17 00:00:00 2001 From: netandreus Date: Thu, 19 Mar 2020 14:35:44 +0300 Subject: [PATCH] Mailbox->getFolders() Ability to load only subscribed folders --- src/Mailbox.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Mailbox.php b/src/Mailbox.php index 464b163..46fa48a 100644 --- a/src/Mailbox.php +++ b/src/Mailbox.php @@ -177,12 +177,13 @@ public function status(string $folder = null) * This function returns an object containing listing the folders. * The object has the following properties: * messages, recent, unseen, uidnext, and uidvalidity. - * + * @param string $rootFolder get folder structure for given folder, else root + * @param bool $subscribedOnly get only subscribed folders or all folders * @return RecursiveIteratorIterator */ - public function getFolders(string $rootFolder = null) + public function getFolders(string $rootFolder = null, $subscribedOnly = false) { - $folders = $this->getImapStream()->getFolders($rootFolder); + $folders = $this->getImapStream()->getFolders($rootFolder, $subscribedOnly); if (! $folders) { return [];