fix: use correct return value of repository
This commit is contained in:
@@ -4,7 +4,7 @@ namespace App\Service\Cron;
|
||||
|
||||
use App\BusProNet\DataProvider\HotelDataProvider;
|
||||
use App\Email\Mailer;
|
||||
use App\Entity\Feedback;
|
||||
use App\Entity\Disposition;
|
||||
use App\Entity\User;
|
||||
use App\Repository\DispositionRepository;
|
||||
use App\Repository\UserRepository;
|
||||
@@ -23,14 +23,14 @@ class FeedbackReminderService
|
||||
|
||||
public function sendFeedbackReminders(): string
|
||||
{
|
||||
/** @var Feedback[] $pendingFeedbacks */
|
||||
$pendingFeedbacks = $this->dispositionRepository->getPendingFeedbacks();
|
||||
/** @var Disposition[] $dispositionsWithPendingFeedbacks */
|
||||
$dispositionsWithPendingFeedbacks = $this->dispositionRepository->findDispositionsWithPendingFeedback();
|
||||
|
||||
$sortedFeedbacks = [];
|
||||
|
||||
foreach ($pendingFeedbacks as $feedback) {
|
||||
foreach ($dispositionsWithPendingFeedbacks as $disposition) {
|
||||
// Get hotel by bus pro id
|
||||
$hotelBusProId = $feedback->getDestination()->getHotelBusProId();
|
||||
$hotelBusProId = $disposition->getAssignment()->getDestination()->getHotelBusProId();
|
||||
$hotel = $this->hotelDataProvider->get($hotelBusProId);
|
||||
|
||||
if (null === $hotel) {
|
||||
@@ -46,7 +46,7 @@ class FeedbackReminderService
|
||||
}
|
||||
|
||||
// Sort feedback by hotel base code
|
||||
$sortedFeedbacks[$hotelBaseCode][] = $feedback;
|
||||
$sortedFeedbacks[$hotelBaseCode][] = $disposition;
|
||||
}
|
||||
|
||||
// Determine hotel managers to notify
|
||||
|
||||
Reference in New Issue
Block a user