@@ -52,18 +52,23 @@ public function pickMailFolder($displayName = null, $parentFolder = 'inbox')
5252 /**
5353 * Get all mail items in the inbox
5454 *
55+ * @param Type\FolderIdType
5556 * @param array $options
5657 * @return Type\MessageType[]
5758 */
58- public function getMailItems ($ options = array ())
59+ public function getMailItems ($ folderId = null , $ options = array ())
5960 {
61+ if (!$ folderId ) {
62+ $ folderId = $ this ->getFolderId ();
63+ }
64+
6065 $ request = array (
6166 'Traversal ' => 'Shallow ' ,
6267 'ItemShape ' => array (
6368 'BaseShape ' => 'AllProperties '
6469 ),
6570 'ParentFolderIds ' => array (
66- 'FolderId ' => $ this -> getFolderId () ->toXmlObject ()
71+ 'FolderId ' => $ folderId ->toXmlObject ()
6772 )
6873 );
6974
@@ -97,7 +102,12 @@ public function getMailItems($options = array())
97102 return $ messages ;
98103 }
99104
100- public function getUnreadMailItems ($ options = array ())
105+ /**
106+ * @param Type\FolderIdType $folderId
107+ * @param array $options
108+ * @return Type\MessageType[]
109+ */
110+ public function getUnreadMailItems ($ folderId = null , $ options = array ())
101111 {
102112 $ unReadOption = array (
103113 'Restriction ' => array (
@@ -109,7 +119,7 @@ public function getUnreadMailItems($options = array())
109119
110120 $ options = array_replace_recursive ($ unReadOption , $ options );
111121
112- return $ this ->getMailItems ($ options );
122+ return $ this ->getMailItems ($ folderId , $ options );
113123 }
114124
115125 /**
0 commit comments