File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 26
26
* @template T of \LeanMapper\Entity
27
27
*
28
28
* @method $this where(string $cond, mixed ...$args)
29
- * @method $this orderBy(string $field)
29
+ * @method $this orderBy(string $field, mixed ...$args )
30
30
* @method $this asc(bool $asc = true)
31
31
* @method $this desc(bool $desc = true)
32
32
* @method $this limit(int $limit)
@@ -658,8 +658,13 @@ private function commandOrderBy($field) // @phpstan-ignore-line
658
658
}
659
659
}
660
660
} else {
661
- $ field = $ this ->parseStatement ($ field );
662
- $ this ->fluent ->orderBy ($ field );
661
+ $ args = func_get_args ();
662
+ // Only first argument is parsed. Other arguments will be maintained
663
+ // as parameters.
664
+ $ statement = &$ args [0 ];
665
+ $ statement = $ this ->parseStatement ($ statement , null );
666
+ $ args = $ this ->replaceEntitiesForItsPrimaryKeyValues ($ args );
667
+ call_user_func_array ([$ this ->fluent , 'orderBy ' ], $ args );
663
668
}
664
669
}
665
670
You can’t perform that action at this time.
0 commit comments