File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 2626 * @template T of \LeanMapper\Entity
2727 *
2828 * @method $this where(string $cond, mixed ...$args)
29- * @method $this orderBy(string $field)
29+ * @method $this orderBy(string $field, mixed ...$args )
3030 * @method $this asc(bool $asc = true)
3131 * @method $this desc(bool $desc = true)
3232 * @method $this limit(int $limit)
@@ -658,8 +658,13 @@ private function commandOrderBy($field) // @phpstan-ignore-line
658658 }
659659 }
660660 } 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 );
663668 }
664669 }
665670
You can’t perform that action at this time.
0 commit comments