This repository was archived by the owner on Dec 8, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -101,11 +101,7 @@ public static function parse($options)
101101 }
102102
103103 if (array_key_exists ('relationships_conditions ' , $ options )) {
104- $ query .= 'rq= ' ;
105- foreach ($ options ['relationships_conditions ' ] as $ condition ) {
106- $ query .= $ condition == end ($ options ['relationships_conditions ' ]) ? $ condition : $ condition . ', ' ;
107- }
108- $ query .= '& ' ;
104+ $ query .= self ::parseRelationshipsCustomConditions ($ options ['relationships_conditions ' ]);
109105 }
110106
111107 if (array_key_exists ('sort ' , $ options )) {
@@ -171,4 +167,18 @@ private function parseCustomConditions(array $conditions): string
171167
172168 return $ query ;
173169 }
170+
171+ /**
172+ * Parse custom conditions Params.
173+ * @param array $relationships
174+ * @return string
175+ * @todo Maybe we can improve this better later.
176+ */
177+ private function parseRelationshipsCustomConditions (array $ conditions ): string
178+ {
179+ foreach ($ conditions as $ key => $ value ) {
180+
181+ return $ query = 'rq=[ ' . $ key . ']=( ' . $ value . ')& ' ;
182+ }
183+ }
174184}
You can’t perform that action at this time.
0 commit comments