getUser(); $teamer = $user->getTeamer(); $news = $this ->entityManager ->getRepository(News::class) ->getLatestForDashboard() ; $matchingAssignments = $this ->entityManager ->getRepository(Assignment::class) ->getNewMatchingTeamerProfile($teamer) ; $recentFeedback = $this ->entityManager ->getRepository(Feedback::class) ->getRecentForTeamer($teamer) ; $pendingApplications = $this ->entityManager ->getRepository(Application::class) ->getPendingForTeamer($teamer) ; $currentDispositions = $this ->entityManager ->getRepository(Disposition::class) ->findCurrentDispositionsByTeamer($teamer) ; $upcomingDispositions = $this ->entityManager ->getRepository(Disposition::class) ->getUpcomingDispositionsByTeamer($teamer) ; $dispositionDocuments = $this->processDocuments($upcomingDispositions); return $this->render('teamer/index.html.twig', [ 'news' => $news, 'teamer' => $teamer, 'matchingAssignments' => $matchingAssignments, 'recentFeedback' => $recentFeedback, 'pendingApplications' => $pendingApplications, 'currentDispositions' => $currentDispositions, 'upcomingDispositions' => $upcomingDispositions, 'dispositionDocuments' => $dispositionDocuments, ]); } private function processDocuments(array $upcomingDispositions): array { $dispositions = []; foreach ($upcomingDispositions as $disposition) { /** @var Disposition $disposition */ if ($disposition->isContractDue() || $disposition->isContractRejected() || $disposition->isInvoiceDue()) { $dispositions[] = $disposition; } } return $dispositions; } }