@@ -1793,21 +1793,19 @@ public function getMaxIndexLength(): int
17931793 /**
17941794 * @param Query $query
17951795 * @param array<string, mixed> $binds
1796- * @param array<mixed> $attributes
17971796 * @return string
17981797 * @throws Exception
17991798 */
1800- abstract protected function getSQLCondition (Query $ query , array &$ binds, array $ attributes = [] ): string ;
1799+ abstract protected function getSQLCondition (Query $ query , array &$ binds ): string ;
18011800
18021801 /**
18031802 * @param array<Query> $queries
18041803 * @param array<string, mixed> $binds
18051804 * @param string $separator
1806- * @param array<mixed> $attributes
18071805 * @return string
18081806 * @throws Exception
18091807 */
1810- public function getSQLConditions (array $ queries , array &$ binds , string $ separator = 'AND ' , array $ attributes = [] ): string
1808+ public function getSQLConditions (array $ queries , array &$ binds , string $ separator = 'AND ' ): string
18111809 {
18121810 $ conditions = [];
18131811 foreach ($ queries as $ query ) {
@@ -1816,9 +1814,9 @@ public function getSQLConditions(array $queries, array &$binds, string $separato
18161814 }
18171815
18181816 if ($ query ->isNested ()) {
1819- $ conditions [] = $ this ->getSQLConditions ($ query ->getValues (), $ binds , $ query ->getMethod (), $ attributes );
1817+ $ conditions [] = $ this ->getSQLConditions ($ query ->getValues (), $ binds , $ query ->getMethod ());
18201818 } else {
1821- $ conditions [] = $ this ->getSQLCondition ($ query , $ binds, $ attributes );
1819+ $ conditions [] = $ this ->getSQLCondition ($ query , $ binds );
18221820 }
18231821 }
18241822
@@ -2316,26 +2314,6 @@ protected function convertArrayToWKT(array $geometry): string
23162314 throw new DatabaseException ('Unrecognized geometry array format ' );
23172315 }
23182316
2319- /**
2320- * Helper method to get attribute type from attributes array
2321- *
2322- * @param string $attributeName
2323- * @param array<mixed> $attributes
2324- * @return string|null
2325- */
2326- protected function getAttributeType (string $ attributeName , array $ attributes ): ?string
2327- {
2328- foreach ($ attributes as $ attribute ) {
2329- if (isset ($ attribute ['$id ' ]) && $ attribute ['$id ' ] === $ attributeName ) {
2330- return $ attribute ['type ' ] ?? null ;
2331- }
2332- if (isset ($ attribute ['key ' ]) && $ attribute ['key ' ] === $ attributeName ) {
2333- return $ attribute ['type ' ] ?? null ;
2334- }
2335- }
2336- return null ;
2337- }
2338-
23392317 /**
23402318 * Find Documents
23412319 *
@@ -2438,7 +2416,7 @@ public function find(Document $collection, array $queries = [], ?int $limit = 25
24382416 $ where [] = '( ' . implode (' OR ' , $ cursorWhere ) . ') ' ;
24392417 }
24402418
2441- $ conditions = $ this ->getSQLConditions ($ queries , $ binds, attributes: $ attributes );
2419+ $ conditions = $ this ->getSQLConditions ($ queries , $ binds );
24422420 if (!empty ($ conditions )) {
24432421 $ where [] = $ conditions ;
24442422 }
@@ -2562,7 +2540,7 @@ public function count(Document $collection, array $queries = [], ?int $max = nul
25622540
25632541 $ queries = array_map (fn ($ query ) => clone $ query , $ queries );
25642542
2565- $ conditions = $ this ->getSQLConditions ($ queries , $ binds, attributes: $ attributes );
2543+ $ conditions = $ this ->getSQLConditions ($ queries , $ binds );
25662544 if (!empty ($ conditions )) {
25672545 $ where [] = $ conditions ;
25682546 }
@@ -2638,7 +2616,7 @@ public function sum(Document $collection, string $attribute, array $queries = []
26382616
26392617 $ queries = array_map (fn ($ query ) => clone $ query , $ queries );
26402618
2641- $ conditions = $ this ->getSQLConditions ($ queries , $ binds, attributes: $ collectionAttributes );
2619+ $ conditions = $ this ->getSQLConditions ($ queries , $ binds );
26422620 if (!empty ($ conditions )) {
26432621 $ where [] = $ conditions ;
26442622 }
0 commit comments