Pārlūkot izejas kodu

bug status

develop
Charly pirms 3 gadiem
vecāks
revīzija
6be8796200
2 mainītis faili ar 17 papildinājumiem un 6 dzēšanām
  1. +12
    -6
      Controller/IndividualData/IndividualDataAdminController.php
  2. +5
    -0
      Repository/IndividualData/IndividualDataRepositoryQuery.php

+ 12
- 6
Controller/IndividualData/IndividualDataAdminController.php Parādīt failu

@@ -15,6 +15,7 @@ use Lc\PietroBundle\Repository\ProjectBoost\ProjectBoostStore;
use Lc\PietroBundle\Repository\ProjectInspiring\ProjectInspiringStore;
use Lc\PietroBundle\Repository\Revolt\RevoltStore;
use Lc\PietroBundle\Controller\AbstractAdminController;
use Lc\SovBundle\Repository\RepositoryQueryInterface;
use Symfony\Component\HttpFoundation\Request;
use Lc\SovBundle\Generator\CsvGenerator;

@@ -49,24 +50,29 @@ abstract class IndividualDataAdminController extends AbstractAdminController
->getFields($pageName);
}

public function createIndexQueryBuilder(
public function getRepositoryQuery(): RepositoryQueryInterface
{
return $this->getIndividualDataContainer()->getRepositoryQuery();
}

public function createIndexRepositoryQuery(
SearchDto $searchDto,
EntityDto $entityDto,
FieldCollection $fields,
FilterCollection $filters
): QueryBuilder {
$queryBuilder = parent::createIndexQueryBuilder(
): RepositoryQueryInterface {
return parent::createIndexRepositoryQuery(
$searchDto,
$entityDto,
$fields,
$filters
);

$repositoryQuery = parent::createIndexRepositoryQuery($searchDto, $entityDto, $fields, $filters);
if ($searchDto->getRequest()->get('status')) {
$queryBuilder->andWhere('entity.status = ' . $searchDto->getRequest()->get('status'));
$repositoryQuery->filterByStatus($searchDto->getRequest()->get('status'));
}

return $queryBuilder;
return $repositoryQuery;
}

public function configureActions(Actions $actions): Actions

+ 5
- 0
Repository/IndividualData/IndividualDataRepositoryQuery.php Parādīt failu

@@ -12,4 +12,9 @@ class IndividualDataRepositoryQuery extends AbstractRepositoryQuery implements R
{
parent::__construct($repository, 'r', $paginator);
}

public function filterByStatus($status)
{
$this->andWhereEqual('status', $status);
}
}

Notiek ielāde…
Atcelt
Saglabāt