Skip to content

Commit 87584a6

Browse files
committed
Ensure default Post sort order shows newer Posts first
1 parent a5643ca commit 87584a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/AppBundle/Controller/Admin/BlogController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class BlogController extends Controller
5454
public function indexAction()
5555
{
5656
$entityManager = $this->getDoctrine()->getManager();
57-
$posts = $entityManager->getRepository(Post::class)->findAll();
57+
$posts = $entityManager->getRepository(Post::class)->findBy([], ['publishedAt' => 'DESC']);
5858

5959
return $this->render('admin/blog/index.html.twig', ['posts' => $posts]);
6060
}

0 commit comments

Comments
 (0)