30 lines
685 B
PHP
30 lines
685 B
PHP
<?php
|
|
|
|
namespace App\Repository\Blog;
|
|
|
|
use App\Core\Repository\RepositoryQuery;
|
|
use Knp\Component\Pager\PaginatorInterface;
|
|
|
|
/**
|
|
* class CommentRepositoryQuery.
|
|
*
|
|
* @author Simon Vieille <simon@deblan.fr>
|
|
*/
|
|
class CommentRepositoryQuery extends RepositoryQuery
|
|
{
|
|
public function __construct(CommentRepository $repository, PaginatorInterface $paginator)
|
|
{
|
|
parent::__construct($repository, 'c', $paginator);
|
|
}
|
|
|
|
protected function filterHandler(string $name, $value)
|
|
{
|
|
if ('post' === $name) {
|
|
$this
|
|
->andWhere('.post = :postId')
|
|
->setParameter(':postId', $value->getId())
|
|
;
|
|
}
|
|
}
|
|
}
|