add possibility to generate filter/order elements, with only search box

for now
This commit is contained in:
2021-10-08 16:50:31 +02:00
parent e286acf9fe
commit 4d71a1c630
15 changed files with 325 additions and 89 deletions

View File

@@ -7,6 +7,7 @@ namespace Chill\AsideActivityBundle\Controller;
use Chill\AsideActivityBundle\Entity\AsideActivity;
use Chill\AsideActivityBundle\Repository\AsideActivityCategoryRepository;
use Chill\MainBundle\CRUD\Controller\CRUDController;
use Chill\MainBundle\Templating\Listing\FilterOrderHelper;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\HttpFoundation\Request;
use Chill\MainBundle\Pagination\PaginatorInterface;
@@ -22,9 +23,9 @@ final class AsideActivityController extends CRUDController
$this->categoryRepository = $categoryRepository;
}
protected function buildQueryEntities(string $action, Request $request)
protected function buildQueryEntities(string $action, Request $request, ?FilterOrderHelper $filterOrder = null)
{
$qb = parent::buildQueryEntities($action, $request);
$qb = parent::buildQueryEntities($action, $request, $filterOrder);
if ('index' === $action) {
$qb->where($qb->expr()->eq('e.agent', ':user'));
@@ -53,7 +54,7 @@ final class AsideActivityController extends CRUDController
$asideActivity = new AsideActivity();
$duration = $request->query->get('duration', '300');
$duration = \DateTime::createFromFormat('U', $duration);
$duration = \DateTime::createFromFormat('U', $duration);
$asideActivity->setDuration($duration);
$categoryId = $request->query->get('type', 7);