@@ -1162,62 +1162,64 @@ public function descendingVectorDistance(string $column, array|string|Subquery $
11621162 /**
11631163 * Adds a ORDER BY clause where nulls come either first or last.
11641164 */
1165- protected function orderByNull (string $ column , SortDirection $ order = SortDirection::Ascending, bool $ nullsLast = true ): static
1166- {
1167- $ this ->orderings [] = [
1168- 'type ' => 'nullOrdering ' ,
1169- 'column ' => $ column ,
1170- 'order ' => $ order ->value ,
1171- 'nullsLast ' => $ nullsLast ,
1172- ];
1165+ protected function orderByNull (array |string $ column , SortDirection $ order = SortDirection::Ascending, bool $ nullsLast = true ): static
1166+ {
1167+ foreach ((array ) $ column as $ col ) {
1168+ $ this ->orderings [] = [
1169+ 'type ' => 'nullOrdering ' ,
1170+ 'column ' => $ col ,
1171+ 'order ' => $ order ->value ,
1172+ 'nullsLast ' => $ nullsLast ,
1173+ ];
1174+ }
11731175
11741176 return $ this ;
11751177 }
11761178
11771179 /**
11781180 * Adds a ORDER BY clause where nulls come first.
11791181 */
1180- public function orderByNullsFirst (string $ column , SortDirection |string $ order = SortDirection::Ascending): static
1182+ public function orderByNullsFirst (array | string $ column , SortDirection |string $ order = SortDirection::Ascending): static
11811183 {
11821184 return $ this ->orderByNull ($ column , $ order , false );
11831185 }
11841186
11851187 /**
11861188 * Adds a ORDER BY clause where nulls come last.
11871189 */
1188- public function orderByNullsLast (string $ column , SortDirection |string $ order = SortDirection::Ascending): static
1190+ public function orderByNullsLast (array | string $ column , SortDirection |string $ order = SortDirection::Ascending): static
11891191 {
11901192 return $ this ->orderByNull ($ column , $ order , true );
11911193 }
11921194
11931195 /**
11941196 * Adds an ascending ORDER BY clause where nulls come first.
11951197 */
1196- public function ascendingNullsFirst (string $ column ): static
1198+ public function ascendingNullsFirst (array | string $ column ): static
11971199 {
11981200 return $ this ->orderByNull ($ column , SortDirection::Ascending, false );
11991201 }
12001202
12011203 /**
12021204 * Adds a descending ORDER BY clause where nulls come first.
12031205 */
1204- public function descendingNullsFirst (string $ column ): static
1206+ public function descendingNullsFirst (array | string $ column ): static
12051207 {
12061208 return $ this ->orderByNull ($ column , SortDirection::Descending, false );
12071209 }
12081210
12091211 /**
12101212 * Adds an ascending ORDER BY clause where nulls come last.
12111213 */
1212- public function ascendingNullsLast (string $ column ): static
1214+ public function ascendingNullsLast (array | string $ column ): static
12131215 {
12141216 return $ this ->orderByNull ($ column , SortDirection::Ascending, true );
12151217 }
12161218
12171219 /**
12181220 * Adds a descending ORDER BY clause where nulls come last.
12191221 */
1220- public function descendingNullsLast (string $ column ): static
1222+ public function descendingNullsLast (array | string $ column ): static
12211223 {
12221224 return $ this ->orderByNull ($ column , SortDirection::Descending, true );
12231225 }
0 commit comments