File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -279,7 +279,7 @@ $aMessage = $oFolder->query()->not()->text('hello world')->get();
279279
280280//Get all messages by custom search criteria
281281/** @var \Webklex\IMAP\Support\MessageCollection $aMessage */
282- $aMessage = $oFolder->query()->where(["CUSTOM_FOOBAR" => "fooBar"]] )->get();
282+ $aMessage = $oFolder->query()->where(["CUSTOM_FOOBAR" => "fooBar"])->get();
283283
284284```
285285
@@ -650,7 +650,6 @@ if you're just wishing a feature ;)
650650| getMsglist | | integer | Get the current message list |
651651| getHeaderInfo | | object | Get the current header_info object |
652652| getHeader | | string | Get the current raw header |
653- | getMessageId | | string | Get the current message ID |
654653| getMessageNo | | integer | Get the current message number |
655654| getPriority | | integer | Get the current message priority |
656655| getSubject | | string | Get the current subject |
Original file line number Diff line number Diff line change @@ -118,12 +118,11 @@ protected function validate_criteria($criteria) {
118118 */
119119 public function where ($ criteria , $ value = null ) {
120120 if (is_array ($ criteria )){
121- foreach ($ criteria as $ arguments ){
122- if (count ($ arguments ) == 1 ){
123- $ this ->where ($ arguments [0 ]);
124- }elseif (count ($ arguments ) == 2 ){
125- $ this ->where ($ arguments [0 ], $ arguments [1 ]);
121+ foreach ($ criteria as $ key => $ value ){
122+ if (is_numeric ($ key )){
123+ return $ this ->where ($ value );
126124 }
125+ return $ this ->where ($ key , $ value );
127126 }
128127 }else {
129128 $ criteria = $ this ->validate_criteria ($ criteria );
You can’t perform that action at this time.
0 commit comments