add node view entity
This commit is contained in:
parent
1f6aaf41e1
commit
1cb57a138f
4 changed files with 171 additions and 0 deletions
27
core/Repository/NodeViewRepositoryQuery.php
Normal file
27
core/Repository/NodeViewRepositoryQuery.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace App\Core\Repository;
|
||||
|
||||
use App\Core\Repository\NodeViewRepository as Repository;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class NodeViewRepositoryQuery 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(),
|
||||
])
|
||||
;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue