mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix cs
This commit is contained in:
parent
f4bca2f410
commit
41fa1d9ca6
@ -9,7 +9,6 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
namespace Chill\PersonBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\Pagination\PaginatorFactory;
|
||||
@ -20,7 +19,6 @@ use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class UserAccompanyingPeriodController extends AbstractController
|
||||
{
|
||||
|
||||
private AccompanyingPeriodRepository $accompanyingPeriodRepository;
|
||||
|
||||
private PaginatorFactory $paginatorFactory;
|
||||
@ -38,13 +36,16 @@ class UserAccompanyingPeriodController extends AbstractController
|
||||
{
|
||||
$total = $this->accompanyingPeriodRepository->countBy(['user' => $this->getUser()]);
|
||||
$pagination = $this->paginatorFactory->create($total);
|
||||
$accompanyingPeriods = $this->accompanyingPeriodRepository->findBy(['user' => $this->getUser()],
|
||||
['openingDate' => 'DESC'], $pagination->getItemsPerPage(), $pagination->getCurrentPageFirstItemNumber());
|
||||
$accompanyingPeriods = $this->accompanyingPeriodRepository->findBy(
|
||||
['user' => $this->getUser()],
|
||||
['openingDate' => 'DESC'],
|
||||
$pagination->getItemsPerPage(),
|
||||
$pagination->getCurrentPageFirstItemNumber()
|
||||
);
|
||||
|
||||
return $this->render('@ChillPerson/AccompanyingPeriod/user_periods_list.html.twig', [
|
||||
'accompanyingPeriods' => $accompanyingPeriods,
|
||||
'pagination' => $pagination,
|
||||
]);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -12,9 +12,7 @@ declare(strict_types=1);
|
||||
namespace Chill\PersonBundle\Menu;
|
||||
|
||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Chill\TaskBundle\Templating\UI\CountNotificationTask;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
@ -25,7 +23,6 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||
*/
|
||||
public $authorizationChecker;
|
||||
|
||||
|
||||
/**
|
||||
* @var TranslatorInterface
|
||||
*/
|
||||
|
@ -26,6 +26,11 @@ final class AccompanyingPeriodRepository implements ObjectRepository
|
||||
$this->repository = $entityManager->getRepository(AccompanyingPeriod::class);
|
||||
}
|
||||
|
||||
public function countBy(array $criteria): int
|
||||
{
|
||||
return $this->repository->count($criteria);
|
||||
}
|
||||
|
||||
public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder
|
||||
{
|
||||
return $this->repository->createQueryBuilder($alias, $indexBy);
|
||||
@ -49,11 +54,6 @@ final class AccompanyingPeriodRepository implements ObjectRepository
|
||||
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
|
||||
}
|
||||
|
||||
public function countBy(array $criteria): int
|
||||
{
|
||||
return $this->repository->count($criteria);
|
||||
}
|
||||
|
||||
public function findOneBy(array $criteria): ?AccompanyingPeriod
|
||||
{
|
||||
return $this->findOneBy($criteria);
|
||||
|
Loading…
x
Reference in New Issue
Block a user