From 8d10914429d0e654223236bf572a3d86677e3a5a Mon Sep 17 00:00:00 2001 From: Joshua Date: Mon, 14 Apr 2025 15:56:19 +0200 Subject: [PATCH] Suppression de StatutTables --- src/Controller/StatutTablesController.php | 74 ------------------- src/Entity/StatutTables.php | 50 ------------- src/Entity/Tables.php | 37 ---------- src/Form/StatutTablesType.php | 32 -------- src/Repository/StatutTablesRepository.php | 43 ----------- .../statut_tables/_delete_form.html.twig | 4 - templates/statut_tables/_form.html.twig | 4 - templates/statut_tables/edit.html.twig | 23 ------ templates/statut_tables/index.html.twig | 41 ---------- templates/statut_tables/new.html.twig | 15 ---- templates/statut_tables/show.html.twig | 29 -------- 11 files changed, 352 deletions(-) delete mode 100644 src/Controller/StatutTablesController.php delete mode 100644 src/Entity/StatutTables.php delete mode 100644 src/Form/StatutTablesType.php delete mode 100644 src/Repository/StatutTablesRepository.php delete mode 100644 templates/statut_tables/_delete_form.html.twig delete mode 100644 templates/statut_tables/_form.html.twig delete mode 100644 templates/statut_tables/edit.html.twig delete mode 100644 templates/statut_tables/index.html.twig delete mode 100644 templates/statut_tables/new.html.twig delete mode 100644 templates/statut_tables/show.html.twig diff --git a/src/Controller/StatutTablesController.php b/src/Controller/StatutTablesController.php deleted file mode 100644 index 84e5c61..0000000 --- a/src/Controller/StatutTablesController.php +++ /dev/null @@ -1,74 +0,0 @@ -render('statut_tables/index.html.twig', [ - 'statut_tables' => $statutTablesRepository->findAll(), - ]); - } - - #[Route('/new', name: 'app_statut_tables_new', methods: ['GET', 'POST'])] - public function new(Request $request, EntityManagerInterface $entityManager): Response - { - $statutTable = new StatutTables(); - $form = $this->createForm(StatutTablesType::class, $statutTable); - $form->handleRequest($request); - - if ($form->isSubmitted() && $form->isValid()) { - $entityManager->persist($statutTable); - $entityManager->flush(); - - return $this->redirectToRoute('app_statut_tables_index', [], Response::HTTP_SEE_OTHER); - } - - return $this->render('statut_tables/new.html.twig', [ - 'statut_table' => $statutTable, - 'form' => $form, - ]); - } - - - #[Route('/{id}/edit', name: 'app_statut_tables_edit', methods: ['GET', 'POST'])] - public function edit(Request $request, StatutTables $statutTable, EntityManagerInterface $entityManager): Response - { - $form = $this->createForm(StatutTablesType::class, $statutTable); - $form->handleRequest($request); - - if ($form->isSubmitted() && $form->isValid()) { - $entityManager->flush(); - - return $this->redirectToRoute('app_statut_tables_index', [], Response::HTTP_SEE_OTHER); - } - - return $this->render('statut_tables/edit.html.twig', [ - 'statut_table' => $statutTable, - 'form' => $form, - ]); - } - - #[Route('/{id}', name: 'app_statut_tables_delete', methods: ['POST'])] - public function delete(Request $request, StatutTables $statutTable, EntityManagerInterface $entityManager): Response - { - if ($this->isCsrfTokenValid('delete'.$statutTable->getId(), $request->getPayload()->getString('_token'))) { - $entityManager->remove($statutTable); - $entityManager->flush(); - } - - return $this->redirectToRoute('app_statut_tables_index', [], Response::HTTP_SEE_OTHER); - } -} diff --git a/src/Entity/StatutTables.php b/src/Entity/StatutTables.php deleted file mode 100644 index 1093ed5..0000000 --- a/src/Entity/StatutTables.php +++ /dev/null @@ -1,50 +0,0 @@ -id; - } - - public function getLibelle(): ?string - { - return $this->Libelle; - } - - public function setLibelle(string $Libelle): static - { - $this->Libelle = $Libelle; - - return $this; - } - - public function getTables(): ?Tables - { - return $this->tables; - } - - public function setTable(?Tables $tables): static - { - $this->tables = $tables; - - return $this; - } -} diff --git a/src/Entity/Tables.php b/src/Entity/Tables.php index ce68a84..f197bb3 100644 --- a/src/Entity/Tables.php +++ b/src/Entity/Tables.php @@ -27,12 +27,6 @@ class Tables #[ORM\OneToMany(targetEntity: Reservations::class, mappedBy: 'tables')] private Collection $reservations; - /** - * @var Collection - */ - #[ORM\OneToMany(targetEntity: StatutTables::class, mappedBy: 'tables')] - private Collection $statutTables; - /** * @var Collection */ @@ -46,7 +40,6 @@ class Tables { $this->Clients = new ArrayCollection(); $this->reservations = new ArrayCollection(); - $this->statutTables = new ArrayCollection(); $this->utilisateurs = new ArrayCollection(); } @@ -112,36 +105,6 @@ class Tables return $this; } - /** - * @return Collection - */ - public function getStatutTables(): Collection - { - return $this->statutTables; - } - - public function addStatutTable(StatutTables $statutTable): static - { - if (!$this->statutTables->contains($statutTable)) { - $this->statutTables->add($statutTable); - $statutTable->setTable($this); - } - - return $this; - } - - public function removeStatutTable(StatutTables $statutTable): static - { - if ($this->statutTables->removeElement($statutTable)) { - // set the owning side to null (unless already changed) - if ($statutTable->getTables() === $this) { - $statutTable->setTable(null); - } - } - - return $this; - } - /** * @return Collection */ diff --git a/src/Form/StatutTablesType.php b/src/Form/StatutTablesType.php deleted file mode 100644 index 70797d0..0000000 --- a/src/Form/StatutTablesType.php +++ /dev/null @@ -1,32 +0,0 @@ -add('Libelle') - ->add('tables', EntityType::class, [ - 'class' => Tables::class, - 'choice_label' => 'id', - 'mapped' => false, - ]) - ; - } - - public function configureOptions(OptionsResolver $resolver): void - { - $resolver->setDefaults([ - 'data_class' => StatutTables::class, - ]); - } -} diff --git a/src/Repository/StatutTablesRepository.php b/src/Repository/StatutTablesRepository.php deleted file mode 100644 index b44f045..0000000 --- a/src/Repository/StatutTablesRepository.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ -class StatutTablesRepository extends ServiceEntityRepository -{ - public function __construct(ManagerRegistry $registry) - { - parent::__construct($registry, StatutTables::class); - } - -// /** -// * @return StatutTables[] Returns an array of StatutTables objects -// */ -// public function findByExampleField($value): array -// { -// return $this->createQueryBuilder('s') -// ->andWhere('s.exampleField = :val') -// ->setParameter('val', $value) -// ->orderBy('s.id', 'ASC') -// ->setMaxResults(10) -// ->getQuery() -// ->getResult() -// ; -// } - -// public function findOneBySomeField($value): ?StatutTables -// { -// return $this->createQueryBuilder('s') -// ->andWhere('s.exampleField = :val') -// ->setParameter('val', $value) -// ->getQuery() -// ->getOneOrNullResult() -// ; -// } -} diff --git a/templates/statut_tables/_delete_form.html.twig b/templates/statut_tables/_delete_form.html.twig deleted file mode 100644 index b61d6a1..0000000 --- a/templates/statut_tables/_delete_form.html.twig +++ /dev/null @@ -1,4 +0,0 @@ -
- - -
diff --git a/templates/statut_tables/_form.html.twig b/templates/statut_tables/_form.html.twig deleted file mode 100644 index 7fe26a6..0000000 --- a/templates/statut_tables/_form.html.twig +++ /dev/null @@ -1,4 +0,0 @@ -{{ form_start(form) }} - {{ form_widget(form) }} - -{{ form_end(form) }} diff --git a/templates/statut_tables/edit.html.twig b/templates/statut_tables/edit.html.twig deleted file mode 100644 index 2a212cd..0000000 --- a/templates/statut_tables/edit.html.twig +++ /dev/null @@ -1,23 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Edit Statut tables{% endblock %} - -{% block stylesheets %} -
-

Modifier Statut tables

- - {{ include('statut_tables/_form.html.twig', {'button_label': 'Mettre à jour'}) }} - -
- {{ include('statut_tables/_delete_form.html.twig') }} -
- Retour à la liste -
- - -
-{% endblock %} - -{% block body %} - -{% endblock %} diff --git a/templates/statut_tables/index.html.twig b/templates/statut_tables/index.html.twig deleted file mode 100644 index fb1dbd7..0000000 --- a/templates/statut_tables/index.html.twig +++ /dev/null @@ -1,41 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}StatutTables index{% endblock %} -{% block stylesheets %} - - -{% endblock %} -{% block body %} -

StatutTables index

- - - - - - - - - - - {% for statut_table in statut_tables %} - - - - - - {% else %} - - - - {% endfor %} - -
IdLibelléactions
{{ statut_table.id }}{{ statut_table.Libelle}} -
- - {{ include('statut_tables/_delete_form.html.twig') }} -
- Modifier -
Aucun enregistrement trouvé
- - Créer un nouveau -{% endblock %} diff --git a/templates/statut_tables/new.html.twig b/templates/statut_tables/new.html.twig deleted file mode 100644 index 9369705..0000000 --- a/templates/statut_tables/new.html.twig +++ /dev/null @@ -1,15 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Créer un nouveau StatutTables{% endblock %} -{% block stylesheets %} - - -{% endblock %} -{% block body %} -

Créer un nouveau StatutTables

- - {{ include('statut_tables/_form.html.twig') }} - -{% endblock %} diff --git a/templates/statut_tables/show.html.twig b/templates/statut_tables/show.html.twig deleted file mode 100644 index 2503d7b..0000000 --- a/templates/statut_tables/show.html.twig +++ /dev/null @@ -1,29 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}StatutTables{% endblock %} -{% block stylesheets %} - - -{% endblock %} -{% block body %} -

StatutTables

- - - - - - - - - - - - -
Id{{ statut_table.id }}
Libellé{{ statut_table.Libelle }}
- - back to list - - edit - - {{ include('statut_tables/_delete_form.html.twig') }} -{% endblock %}