From 2a2853b8ad3d010194ca1d18de2678b34abab54f Mon Sep 17 00:00:00 2001 From: Timo Bakx Date: Thu, 25 Oct 2018 20:17:04 +0200 Subject: [PATCH] Added documentation for the Finder reverseSorting method --- components/finder.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/finder.rst b/components/finder.rst index d8ec90a9727..7bec7c7642c 100644 --- a/components/finder.rst +++ b/components/finder.rst @@ -192,6 +192,13 @@ You can also define your own sorting algorithm with ``sort()`` method:: return strcmp($a->getRealPath(), $b->getRealPath()); }); +You can reverse any sorting by using the ``reverseSorting()`` method:: + + $finder->sortByName()->reverseSorting(); + +.. versionadded:: 4.2 + The ``reverseSorting()`` method to reverse the sort order was introduced in Symfony 4.2. + .. note:: Notice that the ``sort*`` methods need to get all matching elements to do