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