File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed
Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -276,6 +276,11 @@ $aMessage = $oFolder->query()
276276$aMessage = $oFolder->query()->notText('hello world')->get();
277277$aMessage = $oFolder->query()->not_text('hello world')->get();
278278$aMessage = $oFolder->query()->not()->text('hello world')->get();
279+
280+ //Get all messages by custom search criteria
281+ /** @var \Webklex\IMAP\Support\MessageCollection $aMessage */
282+ $aMessage = $oFolder->query()->where(["CUSTOM_FOOBAR" => "fooBar"]])->get();
283+
279284```
280285
281286Available search aliases for a better code reading:
Original file line number Diff line number Diff line change @@ -99,6 +99,9 @@ public function __call($name, $arguments) {
9999 protected function validate_criteria ($ criteria ) {
100100 $ criteria = strtoupper ($ criteria );
101101
102+ if (substr ($ criteria , 0 , 6 ) === "CUSTOM " ) {
103+ return substr ($ criteria , 6 );
104+ }
102105 if (in_array ($ criteria , $ this ->available_criteria ) === false ) {
103106 throw new InvalidWhereQueryCriteriaException ();
104107 }
@@ -391,16 +394,6 @@ public function whereUnseen() {
391394 return $ this ->where ('UNSEEN ' );
392395 }
393396
394- /**
395- * @param $msg_id
396- *
397- * @return WhereQuery
398- * @throws InvalidWhereQueryCriteriaException
399- */
400- public function whereMessageId ($ msg_id ) {
401- return $ this ->where ("Message-ID < $ msg_id> " );
402- }
403-
404397 /**
405398 * @return WhereQuery
406399 * @throws InvalidWhereQueryCriteriaException
You can’t perform that action at this time.
0 commit comments