Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2a2853b

Browse files
committed
Added documentation for the Finder reverseSorting method
1 parent df318b2 commit 2a2853b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

components/finder.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,13 @@ You can also define your own sorting algorithm with ``sort()`` method::
192192
return strcmp($a->getRealPath(), $b->getRealPath());
193193
});
194194

195+
You can reverse any sorting by using the ``reverseSorting()`` method::
196+
197+
$finder->sortByName()->reverseSorting();
198+
199+
.. versionadded:: 4.2
200+
The ``reverseSorting()`` method to reverse the sort order was introduced in Symfony 4.2.
201+
195202
.. note::
196203

197204
Notice that the ``sort*`` methods need to get all matching elements to do

0 commit comments

Comments
 (0)