Ported PublicFeedController.
This commit is contained in:
parent
40db2edc38
commit
77fa05f457
|
@ -1,17 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace src\PointToolsBundle\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
use Knp\Component\Pager\PaginatorInterface;
|
use Knp\Component\Pager\PaginatorInterface;
|
||||||
use src\PointToolsBundle\Repository\Blogs\PostRepository;
|
use App\Repository\Blog\PostRepository;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\{Request, Response};
|
||||||
|
|
||||||
class PublicFeedController extends AbstractController
|
class PublicFeedController extends AbstractController
|
||||||
{
|
{
|
||||||
private const POSTS_PER_PAGE = 20;
|
private const POSTS_PER_PAGE = 20;
|
||||||
|
|
||||||
public function indexAction(Request $request, PostRepository $postRepository, PaginatorInterface $paginator)
|
public function indexAction(Request $request, PostRepository $postRepository, PaginatorInterface $paginator): Response
|
||||||
{
|
{
|
||||||
$postsPagination = $paginator->paginate(
|
$postsPagination = $paginator->paginate(
|
||||||
$postRepository->createPublicFeedPostsQuery(),
|
$postRepository->createPublicFeedPostsQuery(),
|
Loading…
Reference in a new issue