chore: rename methods to better reflect their function
This commit is contained in:
@@ -33,7 +33,7 @@ class DetailController extends AbstractController
|
|||||||
|
|
||||||
$dispositions = $this
|
$dispositions = $this
|
||||||
->dispositionRepository
|
->dispositionRepository
|
||||||
->getCurrentByAssignment($assignment)
|
->findCurrentDispositionsByAssignment($assignment)
|
||||||
;
|
;
|
||||||
|
|
||||||
return $this->render('admin/assignment/detail.html.twig', [
|
return $this->render('admin/assignment/detail.html.twig', [
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class InfoController extends AbstractController
|
|||||||
#[Route('/admin/teamer/info/{uuid}', name: 'app_admin_teamer_info')]
|
#[Route('/admin/teamer/info/{uuid}', name: 'app_admin_teamer_info')]
|
||||||
public function index(Teamer $teamer): JsonResponse
|
public function index(Teamer $teamer): JsonResponse
|
||||||
{
|
{
|
||||||
$recentDispositions = $this->dispositionRepository->getRecentByTeamer($teamer);
|
$recentDispositions = $this->dispositionRepository->findRecentDispositionsByTeamer($teamer);
|
||||||
|
|
||||||
$response = new AjaxModalResponseDto();
|
$response = new AjaxModalResponseDto();
|
||||||
$response->setContent($this->renderView('admin/teamer/info.html.twig', [
|
$response->setContent($this->renderView('admin/teamer/info.html.twig', [
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class RecentAssignmentsController extends AbstractController
|
|||||||
{
|
{
|
||||||
$query = $this
|
$query = $this
|
||||||
->dispositionRepository
|
->dispositionRepository
|
||||||
->getRecentByTeamerQuery($teamer)
|
->getRecentDispositionsByTeamerQuery($teamer)
|
||||||
;
|
;
|
||||||
|
|
||||||
$pagination = $this->paginator->paginate(
|
$pagination = $this->paginator->paginate(
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class IndexController extends AbstractController
|
|||||||
|
|
||||||
$query = $this
|
$query = $this
|
||||||
->dispositionRepository
|
->dispositionRepository
|
||||||
->getPendingFeedbackQuery($hotelBusProIds)
|
->getDispositionsWithPendingFeedbackQuery($hotelBusProIds)
|
||||||
;
|
;
|
||||||
|
|
||||||
$pagination = $this->paginator->paginate(
|
$pagination = $this->paginator->paginate(
|
||||||
|
|||||||
@@ -37,12 +37,12 @@ class IndexController extends AbstractController
|
|||||||
|
|
||||||
$newDispositions = $this
|
$newDispositions = $this
|
||||||
->dispositionRepository
|
->dispositionRepository
|
||||||
->getNewByHotelBusProIds($hotelBusProIds)
|
->findNewDispositionsByHotelBusProIds($hotelBusProIds)
|
||||||
;
|
;
|
||||||
|
|
||||||
$pendingFeedbacks = $this
|
$pendingFeedbacks = $this
|
||||||
->dispositionRepository
|
->dispositionRepository
|
||||||
->getPendingFeedbackByHotelBusProIds($hotelBusProIds)
|
->findDispositionsWithPendingFeedbackByHotelBusProIds($hotelBusProIds)
|
||||||
;
|
;
|
||||||
|
|
||||||
return $this->render('house_manager/index.html.twig', [
|
return $this->render('house_manager/index.html.twig', [
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class RecentController extends AbstractController
|
|||||||
|
|
||||||
$query = $this
|
$query = $this
|
||||||
->dispositionRepository
|
->dispositionRepository
|
||||||
->getRecentByTeamerQuery($teamer)
|
->getRecentDispositionsByTeamerQuery($teamer)
|
||||||
;
|
;
|
||||||
|
|
||||||
$pagination = $this->paginator->paginate(
|
$pagination = $this->paginator->paginate(
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class UpcomingController extends AbstractController
|
|||||||
|
|
||||||
$query = $this
|
$query = $this
|
||||||
->dispositionRepository
|
->dispositionRepository
|
||||||
->getUpcomingByTeamerQuery($teamer)
|
->getUpcomingDispositionsByTeamerQuery($teamer)
|
||||||
;
|
;
|
||||||
|
|
||||||
$pagination = $this->paginator->paginate(
|
$pagination = $this->paginator->paginate(
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class DispositionRepository extends ServiceEntityRepository
|
|||||||
parent::__construct($registry, Disposition::class);
|
parent::__construct($registry, Disposition::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUpcomingByTeamerQuery(Teamer $teamer): Query
|
public function getUpcomingDispositionsByTeamerQuery(Teamer $teamer): Query
|
||||||
{
|
{
|
||||||
$qb = $this->createQueryBuilder('disposition');
|
$qb = $this->createQueryBuilder('disposition');
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ class DispositionRepository extends ServiceEntityRepository
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRecentByTeamerQuery(Teamer $teamer): Query
|
public function getRecentDispositionsByTeamerQuery(Teamer $teamer): Query
|
||||||
{
|
{
|
||||||
$qb = $this->createQueryBuilder('disposition');
|
$qb = $this->createQueryBuilder('disposition');
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ class DispositionRepository extends ServiceEntityRepository
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCurrentByAssignment(Assignment $assignment): array
|
public function findCurrentDispositionsByAssignment(Assignment $assignment): array
|
||||||
{
|
{
|
||||||
$qb = $this->createQueryBuilder('disposition');
|
$qb = $this->createQueryBuilder('disposition');
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ class DispositionRepository extends ServiceEntityRepository
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRecentByTeamer(Teamer $teamer, int $limit = 5): array
|
public function findRecentDispositionsByTeamer(Teamer $teamer, int $limit = 5): array
|
||||||
{
|
{
|
||||||
$qb = $this->createQueryBuilder('disposition');
|
$qb = $this->createQueryBuilder('disposition');
|
||||||
|
|
||||||
@@ -113,7 +113,7 @@ class DispositionRepository extends ServiceEntityRepository
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNewByHotelBusProIds(array $hotelBusProIds): array
|
public function findNewDispositionsByHotelBusProIds(array $hotelBusProIds): array
|
||||||
{
|
{
|
||||||
$qb = $this->createQueryBuilder('disposition');
|
$qb = $this->createQueryBuilder('disposition');
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ class DispositionRepository extends ServiceEntityRepository
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPendingFeedbackQuery(array $hotelBusProIds = null): Query
|
public function getDispositionsWithPendingFeedbackQuery(array $hotelBusProIds = null): Query
|
||||||
{
|
{
|
||||||
$qb = $this->createQueryBuilder('disposition');
|
$qb = $this->createQueryBuilder('disposition');
|
||||||
|
|
||||||
@@ -157,18 +157,18 @@ class DispositionRepository extends ServiceEntityRepository
|
|||||||
return $qb->getQuery();
|
return $qb->getQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPendingFeedbacks(): array
|
public function findDispositionsWithPendingFeedback(): array
|
||||||
{
|
{
|
||||||
return $this
|
return $this
|
||||||
->getPendingFeedbackQuery()
|
->getDispositionsWithPendingFeedbackQuery()
|
||||||
->getResult()
|
->getResult()
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPendingFeedbackByHotelBusProIds(array $hotelBusProIds): array
|
public function findDispositionsWithPendingFeedbackByHotelBusProIds(array $hotelBusProIds): array
|
||||||
{
|
{
|
||||||
return $this
|
return $this
|
||||||
->getPendingFeedbackQuery($hotelBusProIds)
|
->getDispositionsWithPendingFeedbackQuery($hotelBusProIds)
|
||||||
->getResult()
|
->getResult()
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class AssignmentVoter extends Voter
|
|||||||
$dispositions = $this
|
$dispositions = $this
|
||||||
->entityManager
|
->entityManager
|
||||||
->getRepository(Disposition::class)
|
->getRepository(Disposition::class)
|
||||||
->getCurrentByAssignment($assignment)
|
->findCurrentDispositionsByAssignment($assignment)
|
||||||
;
|
;
|
||||||
|
|
||||||
return count($dispositions) < $availableSlots;
|
return count($dispositions) < $availableSlots;
|
||||||
|
|||||||
Reference in New Issue
Block a user