2022-03-13 19:32:32 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Core\Repository\Analytic;
|
|
|
|
|
|
|
|
use App\Core\Repository\Analytic\ViewRepository as Repository;
|
2023-10-12 16:15:07 +02:00
|
|
|
use App\Core\Repository\RepositoryQuery;
|
2022-03-13 19:32:32 +01:00
|
|
|
use Knp\Component\Pager\PaginatorInterface;
|
|
|
|
use Symfony\Component\HttpFoundation\Request;
|
|
|
|
|
|
|
|
class ViewRepositoryQuery extends RepositoryQuery
|
|
|
|
{
|
|
|
|
public function __construct(Repository $repository, PaginatorInterface $paginator)
|
|
|
|
{
|
|
|
|
parent::__construct($repository, 'n', $paginator);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function filterByRequest(Request $request)
|
|
|
|
{
|
|
|
|
return $this
|
|
|
|
->andWhere('.node = :node')
|
|
|
|
->andWhere('.path = :path')
|
|
|
|
->setParameters([
|
|
|
|
':node' => $request->attributes->get('_node'),
|
|
|
|
':path' => $request->getPathInfo(),
|
|
|
|
])
|
|
|
|
;
|
|
|
|
}
|
|
|
|
}
|