@@ -81,6 +81,25 @@ class Query
8181 self ::TYPE_OR ,
8282 ];
8383
84+ protected const FILTER_TYPES = [
85+ self ::TYPE_EQUAL ,
86+ self ::TYPE_NOT_EQUAL ,
87+ self ::TYPE_LESSER ,
88+ self ::TYPE_LESSER_EQUAL ,
89+ self ::TYPE_GREATER ,
90+ self ::TYPE_GREATER_EQUAL ,
91+ self ::TYPE_CONTAINS ,
92+ self ::TYPE_SEARCH ,
93+ self ::TYPE_IS_NULL ,
94+ self ::TYPE_IS_NOT_NULL ,
95+ self ::TYPE_BETWEEN ,
96+ self ::TYPE_STARTS_WITH ,
97+ self ::TYPE_ENDS_WITH ,
98+ self ::TYPE_AND ,
99+ self ::TYPE_OR ,
100+ self ::TYPE_RELATION_EQUAL ,
101+ ];
102+
84103 protected string $ method = '' ;
85104 protected string $ collection = '' ;
86105 protected string $ alias = '' ;
@@ -844,24 +863,7 @@ public function getCursorDocument(?Query $query): Document
844863 */
845864 public static function getFilterQueries (array $ queries ): array
846865 {
847- return self ::getByType ($ queries , [
848- self ::TYPE_EQUAL ,
849- self ::TYPE_NOT_EQUAL ,
850- self ::TYPE_LESSER ,
851- self ::TYPE_LESSER_EQUAL ,
852- self ::TYPE_GREATER ,
853- self ::TYPE_GREATER_EQUAL ,
854- self ::TYPE_CONTAINS ,
855- self ::TYPE_SEARCH ,
856- self ::TYPE_IS_NULL ,
857- self ::TYPE_IS_NOT_NULL ,
858- self ::TYPE_BETWEEN ,
859- self ::TYPE_STARTS_WITH ,
860- self ::TYPE_ENDS_WITH ,
861- self ::TYPE_AND ,
862- self ::TYPE_OR ,
863- self ::TYPE_RELATION_EQUAL ,
864- ]);
866+ return self ::getByType ($ queries , self ::FILTER_TYPES );
865867 }
866868
867869 /**
@@ -879,7 +881,7 @@ public static function getFilterQueries(array $queries): array
879881 * cursorDirection: string|null
880882 * }
881883 */
882- public static function groupByType (array $ queries ): array
884+ public static function groupByType_deprecated (array $ queries ): array
883885 {
884886 $ filters = [];
885887 $ joins = [];
@@ -996,6 +998,11 @@ public function isJoin(): bool
996998 return false ;
997999 }
9981000
1001+ public static function isFilter (string $ method ): bool
1002+ {
1003+ return in_array ($ method , self ::FILTER_TYPES );
1004+ }
1005+
9991006 public function onArray (): bool
10001007 {
10011008 return $ this ->onArray ;
0 commit comments