mirror of
https://github.com/MarijnDoeve/TijdVoorDeTest.git
synced 2026-03-06 20:54:20 +01:00
Refactor entities and codebase for native property usage
- Replaced getters/setters with direct property access across entities and repositories. - Added and configured `martin-georgiev/postgresql-for-doctrine` for PostgreSQL enhancements. - Updated Doctrine configuration with types, mappings, and JSONB query functions. - Removed unused `EliminationService` and related YAML configurations.
This commit is contained in:
@@ -39,7 +39,7 @@ final class EliminationController extends AbstractController
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$name = $form->get('name')->getData();
|
||||
|
||||
return $this->redirectToRoute('tvdt_elimination_candidate', ['elimination' => $elimination->getId(), 'candidateHash' => Base64::base64UrlEncode($name)]);
|
||||
return $this->redirectToRoute('tvdt_elimination_candidate', ['elimination' => $elimination->id, 'candidateHash' => Base64::base64UrlEncode($name)]);
|
||||
}
|
||||
|
||||
return $this->render('quiz/elimination/index.html.twig', [
|
||||
@@ -52,21 +52,21 @@ final class EliminationController extends AbstractController
|
||||
#[Route('/elimination/{elimination}/{candidateHash}', name: 'tvdt_elimination_candidate', requirements: ['elimination' => Requirement::UUID, 'candidateHash' => self::CANDIDATE_HASH_REGEX])]
|
||||
public function candidateScreen(Elimination $elimination, string $candidateHash, CandidateRepository $candidateRepository): Response
|
||||
{
|
||||
$candidate = $candidateRepository->getCandidateByHash($elimination->getQuiz()->getSeason(), $candidateHash);
|
||||
$candidate = $candidateRepository->getCandidateByHash($elimination->quiz->season, $candidateHash);
|
||||
if (!$candidate instanceof Candidate) {
|
||||
$this->addFlash(FlashType::Warning,
|
||||
t('Cound not find candidate with name %name%', ['%name%' => Base64::base64UrlDecode($candidateHash)])->trans($this->translator),
|
||||
);
|
||||
|
||||
return $this->redirectToRoute('tvdt_elimination', ['elimination' => $elimination->getId()]);
|
||||
return $this->redirectToRoute('tvdt_elimination', ['elimination' => $elimination->id]);
|
||||
}
|
||||
|
||||
$screenColour = $elimination->getScreenColour($candidate->getName());
|
||||
$screenColour = $elimination->getScreenColour($candidate->name);
|
||||
|
||||
if (null === $screenColour) {
|
||||
$this->addFlash(FlashType::Warning, $this->translator->trans('Cound not find candidate with name %name% in elimination.', ['%name%' => $candidate->getName()]));
|
||||
$this->addFlash(FlashType::Warning, $this->translator->trans('Cound not find candidate with name %name% in elimination.', ['%name%' => $candidate->name]));
|
||||
|
||||
return $this->redirectToRoute('tvdt_elimination', ['elimination' => $elimination->getId()]);
|
||||
return $this->redirectToRoute('tvdt_elimination', ['elimination' => $elimination->id]);
|
||||
}
|
||||
|
||||
return $this->render('quiz/elimination/candidate.html.twig', [
|
||||
|
||||
Reference in New Issue
Block a user