mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
admin: refine social work admin form
This commit is contained in:
@@ -19,8 +19,11 @@ use Chill\MainBundle\Form\UserCurrentLocationType;
|
||||
use Chill\MainBundle\Form\UserPasswordType;
|
||||
use Chill\MainBundle\Form\UserType;
|
||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||
use Chill\MainBundle\Templating\Listing\FilterOrderHelper;
|
||||
use Chill\MainBundle\Templating\Listing\FilterOrderHelperFactoryInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use RuntimeException;
|
||||
use LogicException;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\Form;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
@@ -41,14 +44,57 @@ class UserController extends CRUDController
|
||||
|
||||
private ValidatorInterface $validator;
|
||||
|
||||
private FilterOrderHelperFactoryInterface $filterOrderHelperFactory;
|
||||
|
||||
public function __construct(
|
||||
LoggerInterface $chillLogger,
|
||||
ValidatorInterface $validator,
|
||||
UserPasswordEncoderInterface $passwordEncoder
|
||||
UserPasswordEncoderInterface $passwordEncoder,
|
||||
FilterOrderHelperFactoryInterface $filterOrderHelperFactory
|
||||
) {
|
||||
$this->logger = $chillLogger;
|
||||
$this->validator = $validator;
|
||||
$this->passwordEncoder = $passwordEncoder;
|
||||
$this->filterOrderHelperFactory = $filterOrderHelperFactory;
|
||||
}
|
||||
|
||||
|
||||
// public function index(Request $request)
|
||||
// {
|
||||
// dump($request);
|
||||
|
||||
// //$filterOrder = $this->buildFilterOrderHelper('index', $request);
|
||||
// return parent::indexEntityAction('index', $request);
|
||||
// }
|
||||
|
||||
// protected function buildFilterOrderHelper($action, $request): FilterOrderHelper
|
||||
// {
|
||||
// $filter_order = $this->filterOrderHelperFactory
|
||||
// ->create(self::class)
|
||||
// ->addSearchBox(['name'])
|
||||
// ->build();
|
||||
// dump($filter_order);
|
||||
// return $filter_order;
|
||||
// }
|
||||
|
||||
protected function buildFilterOrderHelper(string $action, Request $request): ?FilterOrderHelper
|
||||
{
|
||||
return $this->getFilterOrderHelperFactory()
|
||||
->create(self::class)
|
||||
->addSearchBox(['label'])
|
||||
->build();
|
||||
}
|
||||
|
||||
protected function countEntities(string $action, Request $request, ?FilterOrderHelper $filterOrder = null): int
|
||||
{
|
||||
if (null === $filterOrder) {
|
||||
throw new LogicException('filterOrder should not be null');
|
||||
}
|
||||
dump($filterOrder);
|
||||
$count = parent::countEntities($action, $request, $filterOrder);
|
||||
|
||||
dump($count);
|
||||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user