@@ -9937,27 +9937,22 @@ public function getStatus(): int
9937
9937
9938
9938
class FilterInfo
9939
9939
{
9940
- private function addConditionFromFilterPath (PathTree $ conditions , array $ path , ReflectedTable $ table , array $ params )
9941
- {
9942
- $ key = 'filter ' . implode ('' , $ path );
9943
- if (isset ($ params [$ key ])) {
9944
- foreach ($ params [$ key ] as $ filter ) {
9945
- $ condition = Condition::fromString ($ table , $ filter );
9946
- if (($ condition instanceof NoCondition) == false ) {
9947
- $ conditions ->put ($ path , $ condition );
9948
- }
9949
- }
9950
- }
9951
- }
9952
-
9953
9940
private function getConditionsAsPathTree (ReflectedTable $ table , array $ params ): PathTree
9954
9941
{
9955
9942
$ conditions = new PathTree ();
9956
- $ this ->addConditionFromFilterPath ($ conditions , [], $ table , $ params );
9957
- for ($ n = ord ('0 ' ); $ n <= ord ('9 ' ); $ n ++) {
9958
- $ this ->addConditionFromFilterPath ($ conditions , [chr ($ n )], $ table , $ params );
9959
- for ($ l = ord ('a ' ); $ l <= ord ('f ' ); $ l ++) {
9960
- $ this ->addConditionFromFilterPath ($ conditions , [chr ($ n ), chr ($ l )], $ table , $ params );
9943
+ foreach ($ params as $ key => $ filters ) {
9944
+ if (substr ($ key , 0 , 6 ) == 'filter ' ) {
9945
+ $ path = [];
9946
+ $ suffix = substr ($ key , 6 );
9947
+ if ($ suffix ) {
9948
+ $ path = str_split ($ suffix );
9949
+ }
9950
+ foreach ($ filters as $ filter ) {
9951
+ $ condition = Condition::fromString ($ table , $ filter );
9952
+ if (($ condition instanceof NoCondition) == false ) {
9953
+ $ conditions ->put ($ path , $ condition );
9954
+ }
9955
+ }
9961
9956
}
9962
9957
}
9963
9958
return $ conditions ;
0 commit comments