From d6b82235b541bca19ed125a4a08beb62f8f1607a Mon Sep 17 00:00:00 2001 From: Joshua Date: Thu, 17 Oct 2024 16:34:44 +0200 Subject: [PATCH] Finition des Tables et des relations, tout OK normalement + Repository et Migrations --- migrations/Version20241017131649.php | 56 ++++++ migrations/Version20241017131858.php | 37 ++++ migrations/Version20241017132345.php | 41 ++++ migrations/Version20241017132656.php | 45 +++++ migrations/Version20241017133242.php | 49 +++++ migrations/Version20241017141106.php | 44 +++++ migrations/Version20241017141339.php | 46 +++++ migrations/Version20241017141858.php | 38 ++++ migrations/Version20241017142439.php | 36 ++++ migrations/Version20241017142915.php | 42 +++++ src/Entity/Clients.php | 34 ++++ src/Entity/Commandes.php | 189 +++++++++++++++++++ src/Entity/DetailsCommande.php | 65 +++++++ src/Entity/Plats.php | 162 ++++++++++++++++ src/Entity/Reductions.php | 154 +++++++++++++++ src/Entity/StatutCommandes.php | 78 ++++++++ src/Entity/StatutTables.php | 50 +++++ src/Entity/Tables.php | 89 ++++++++- src/Entity/Utilisateurs.php | 31 +++ src/Repository/ClientsRepository.php | 43 +++++ src/Repository/CommandesRepository.php | 43 +++++ src/Repository/DetailsCommandeRepository.php | 43 +++++ src/Repository/PlatsRepository.php | 43 +++++ src/Repository/ReductionsRepository.php | 43 +++++ src/Repository/ReservationsRepository.php | 43 +++++ src/Repository/StatutCommandesRepository.php | 43 +++++ src/Repository/StatutTablesRepository.php | 43 +++++ src/Repository/TablesRepository.php | 43 +++++ src/Repository/UtilisateursRepository.php | 43 +++++ 29 files changed, 1707 insertions(+), 9 deletions(-) create mode 100644 migrations/Version20241017131649.php create mode 100644 migrations/Version20241017131858.php create mode 100644 migrations/Version20241017132345.php create mode 100644 migrations/Version20241017132656.php create mode 100644 migrations/Version20241017133242.php create mode 100644 migrations/Version20241017141106.php create mode 100644 migrations/Version20241017141339.php create mode 100644 migrations/Version20241017141858.php create mode 100644 migrations/Version20241017142439.php create mode 100644 migrations/Version20241017142915.php create mode 100644 src/Entity/Commandes.php create mode 100644 src/Entity/DetailsCommande.php create mode 100644 src/Entity/Plats.php create mode 100644 src/Entity/Reductions.php create mode 100644 src/Entity/StatutCommandes.php create mode 100644 src/Entity/StatutTables.php create mode 100644 src/Repository/ClientsRepository.php create mode 100644 src/Repository/CommandesRepository.php create mode 100644 src/Repository/DetailsCommandeRepository.php create mode 100644 src/Repository/PlatsRepository.php create mode 100644 src/Repository/ReductionsRepository.php create mode 100644 src/Repository/ReservationsRepository.php create mode 100644 src/Repository/StatutCommandesRepository.php create mode 100644 src/Repository/StatutTablesRepository.php create mode 100644 src/Repository/TablesRepository.php create mode 100644 src/Repository/UtilisateursRepository.php diff --git a/migrations/Version20241017131649.php b/migrations/Version20241017131649.php new file mode 100644 index 0000000..2e7d695 --- /dev/null +++ b/migrations/Version20241017131649.php @@ -0,0 +1,56 @@ +addSql('DROP SEQUENCE customer_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE discount_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE dishes_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE order_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE order_detail_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE reservation_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE status_order_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE status_table_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE table_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE user_id_seq CASCADE'); + $this->addSql('ALTER TABLE utilisateurs ADD tabl_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE utilisateurs ADD CONSTRAINT FK_497B315E4DE1870D FOREIGN KEY (tabl_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('CREATE INDEX IDX_497B315E4DE1870D ON utilisateurs (tabl_id)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('CREATE SEQUENCE customer_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE discount_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE dishes_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE order_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE order_detail_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE reservation_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE status_order_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE status_table_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE table_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE user_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('ALTER TABLE utilisateurs DROP CONSTRAINT FK_497B315E4DE1870D'); + $this->addSql('DROP INDEX IDX_497B315E4DE1870D'); + $this->addSql('ALTER TABLE utilisateurs DROP tabl_id'); + } +} diff --git a/migrations/Version20241017131858.php b/migrations/Version20241017131858.php new file mode 100644 index 0000000..38f39b2 --- /dev/null +++ b/migrations/Version20241017131858.php @@ -0,0 +1,37 @@ +addSql('CREATE SEQUENCE statut_tables_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE TABLE statut_tables (id INT NOT NULL, tabl_id INT DEFAULT NULL, libellé VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_33C8A3754DE1870D ON statut_tables (tabl_id)'); + $this->addSql('ALTER TABLE statut_tables ADD CONSTRAINT FK_33C8A3754DE1870D FOREIGN KEY (tabl_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('DROP SEQUENCE statut_tables_id_seq CASCADE'); + $this->addSql('ALTER TABLE statut_tables DROP CONSTRAINT FK_33C8A3754DE1870D'); + $this->addSql('DROP TABLE statut_tables'); + } +} diff --git a/migrations/Version20241017132345.php b/migrations/Version20241017132345.php new file mode 100644 index 0000000..924e315 --- /dev/null +++ b/migrations/Version20241017132345.php @@ -0,0 +1,41 @@ +addSql('CREATE SEQUENCE commandes_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE statut_commandes_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE TABLE commandes (id INT NOT NULL, date_heure TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, statut BOOLEAN NOT NULL, total DOUBLE PRECISION NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE statut_commandes (id INT NOT NULL, commande_id INT DEFAULT NULL, libellé VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_947ABDEE82EA2E54 ON statut_commandes (commande_id)'); + $this->addSql('ALTER TABLE statut_commandes ADD CONSTRAINT FK_947ABDEE82EA2E54 FOREIGN KEY (commande_id) REFERENCES commandes (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('DROP SEQUENCE commandes_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE statut_commandes_id_seq CASCADE'); + $this->addSql('ALTER TABLE statut_commandes DROP CONSTRAINT FK_947ABDEE82EA2E54'); + $this->addSql('DROP TABLE commandes'); + $this->addSql('DROP TABLE statut_commandes'); + } +} diff --git a/migrations/Version20241017132656.php b/migrations/Version20241017132656.php new file mode 100644 index 0000000..156d08a --- /dev/null +++ b/migrations/Version20241017132656.php @@ -0,0 +1,45 @@ +addSql('CREATE SEQUENCE details_commande_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE TABLE commandes_clients (commandes_id INT NOT NULL, clients_id INT NOT NULL, PRIMARY KEY(commandes_id, clients_id))'); + $this->addSql('CREATE INDEX IDX_C665A6248BF5C2E6 ON commandes_clients (commandes_id)'); + $this->addSql('CREATE INDEX IDX_C665A624AB014612 ON commandes_clients (clients_id)'); + $this->addSql('CREATE TABLE details_commande (id INT NOT NULL, commande_id INT DEFAULT NULL, quantite INT NOT NULL, prix_unitaire DOUBLE PRECISION NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_4BCD5F682EA2E54 ON details_commande (commande_id)'); + $this->addSql('ALTER TABLE commandes_clients ADD CONSTRAINT FK_C665A6248BF5C2E6 FOREIGN KEY (commandes_id) REFERENCES commandes (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE commandes_clients ADD CONSTRAINT FK_C665A624AB014612 FOREIGN KEY (clients_id) REFERENCES clients (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE details_commande ADD CONSTRAINT FK_4BCD5F682EA2E54 FOREIGN KEY (commande_id) REFERENCES commandes (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('DROP SEQUENCE details_commande_id_seq CASCADE'); + $this->addSql('ALTER TABLE commandes_clients DROP CONSTRAINT FK_C665A6248BF5C2E6'); + $this->addSql('ALTER TABLE commandes_clients DROP CONSTRAINT FK_C665A624AB014612'); + $this->addSql('ALTER TABLE details_commande DROP CONSTRAINT FK_4BCD5F682EA2E54'); + $this->addSql('DROP TABLE commandes_clients'); + $this->addSql('DROP TABLE details_commande'); + } +} diff --git a/migrations/Version20241017133242.php b/migrations/Version20241017133242.php new file mode 100644 index 0000000..43470c9 --- /dev/null +++ b/migrations/Version20241017133242.php @@ -0,0 +1,49 @@ +addSql('CREATE SEQUENCE plats_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE reductions_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE TABLE plats (id INT NOT NULL, reduction_id INT DEFAULT NULL, nom VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, prix DOUBLE PRECISION NOT NULL, categorie VARCHAR(255) NOT NULL, statut BOOLEAN NOT NULL, nb_de_commande INT NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_854A620AC03CB092 ON plats (reduction_id)'); + $this->addSql('CREATE TABLE plats_commandes (plats_id INT NOT NULL, commandes_id INT NOT NULL, PRIMARY KEY(plats_id, commandes_id))'); + $this->addSql('CREATE INDEX IDX_7F8CABAAAA14E1C8 ON plats_commandes (plats_id)'); + $this->addSql('CREATE INDEX IDX_7F8CABAA8BF5C2E6 ON plats_commandes (commandes_id)'); + $this->addSql('CREATE TABLE reductions (id INT NOT NULL, description VARCHAR(255) NOT NULL, prix DOUBLE PRECISION NOT NULL, pourcentage INT NOT NULL, montant_fixe VARCHAR(255) NOT NULL, date_debut TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, date_fin TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(id))'); + $this->addSql('ALTER TABLE plats ADD CONSTRAINT FK_854A620AC03CB092 FOREIGN KEY (reduction_id) REFERENCES reductions (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE plats_commandes ADD CONSTRAINT FK_7F8CABAAAA14E1C8 FOREIGN KEY (plats_id) REFERENCES plats (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE plats_commandes ADD CONSTRAINT FK_7F8CABAA8BF5C2E6 FOREIGN KEY (commandes_id) REFERENCES commandes (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('DROP SEQUENCE plats_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE reductions_id_seq CASCADE'); + $this->addSql('ALTER TABLE plats DROP CONSTRAINT FK_854A620AC03CB092'); + $this->addSql('ALTER TABLE plats_commandes DROP CONSTRAINT FK_7F8CABAAAA14E1C8'); + $this->addSql('ALTER TABLE plats_commandes DROP CONSTRAINT FK_7F8CABAA8BF5C2E6'); + $this->addSql('DROP TABLE plats'); + $this->addSql('DROP TABLE plats_commandes'); + $this->addSql('DROP TABLE reductions'); + } +} diff --git a/migrations/Version20241017141106.php b/migrations/Version20241017141106.php new file mode 100644 index 0000000..35ff953 --- /dev/null +++ b/migrations/Version20241017141106.php @@ -0,0 +1,44 @@ +addSql('CREATE TABLE tables_tables (tables_source INT NOT NULL, tables_target INT NOT NULL, PRIMARY KEY(tables_source, tables_target))'); + $this->addSql('CREATE INDEX IDX_D19ED3B4A53AEE6 ON tables_tables (tables_source)'); + $this->addSql('CREATE INDEX IDX_D19ED3B413B6FE69 ON tables_tables (tables_target)'); + $this->addSql('ALTER TABLE tables_tables ADD CONSTRAINT FK_D19ED3B4A53AEE6 FOREIGN KEY (tables_source) REFERENCES tables (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE tables_tables ADD CONSTRAINT FK_D19ED3B413B6FE69 FOREIGN KEY (tables_target) REFERENCES tables (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE utilisateurs DROP CONSTRAINT fk_497b315e4de1870d'); + $this->addSql('DROP INDEX idx_497b315e4de1870d'); + $this->addSql('ALTER TABLE utilisateurs DROP tabl_id'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('ALTER TABLE tables_tables DROP CONSTRAINT FK_D19ED3B4A53AEE6'); + $this->addSql('ALTER TABLE tables_tables DROP CONSTRAINT FK_D19ED3B413B6FE69'); + $this->addSql('DROP TABLE tables_tables'); + $this->addSql('ALTER TABLE utilisateurs ADD tabl_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE utilisateurs ADD CONSTRAINT fk_497b315e4de1870d FOREIGN KEY (tabl_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('CREATE INDEX idx_497b315e4de1870d ON utilisateurs (tabl_id)'); + } +} diff --git a/migrations/Version20241017141339.php b/migrations/Version20241017141339.php new file mode 100644 index 0000000..8a16d2c --- /dev/null +++ b/migrations/Version20241017141339.php @@ -0,0 +1,46 @@ +addSql('CREATE TABLE utilisateurs_tables (utilisateurs_id INT NOT NULL, tables_id INT NOT NULL, PRIMARY KEY(utilisateurs_id, tables_id))'); + $this->addSql('CREATE INDEX IDX_A9A665291E969C5 ON utilisateurs_tables (utilisateurs_id)'); + $this->addSql('CREATE INDEX IDX_A9A6652985405FD2 ON utilisateurs_tables (tables_id)'); + $this->addSql('ALTER TABLE utilisateurs_tables ADD CONSTRAINT FK_A9A665291E969C5 FOREIGN KEY (utilisateurs_id) REFERENCES utilisateurs (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE utilisateurs_tables ADD CONSTRAINT FK_A9A6652985405FD2 FOREIGN KEY (tables_id) REFERENCES tables (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE tables_tables DROP CONSTRAINT fk_d19ed3b4a53aee6'); + $this->addSql('ALTER TABLE tables_tables DROP CONSTRAINT fk_d19ed3b413b6fe69'); + $this->addSql('DROP TABLE tables_tables'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('CREATE TABLE tables_tables (tables_source INT NOT NULL, tables_target INT NOT NULL, PRIMARY KEY(tables_source, tables_target))'); + $this->addSql('CREATE INDEX idx_d19ed3b413b6fe69 ON tables_tables (tables_target)'); + $this->addSql('CREATE INDEX idx_d19ed3b4a53aee6 ON tables_tables (tables_source)'); + $this->addSql('ALTER TABLE tables_tables ADD CONSTRAINT fk_d19ed3b4a53aee6 FOREIGN KEY (tables_source) REFERENCES tables (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE tables_tables ADD CONSTRAINT fk_d19ed3b413b6fe69 FOREIGN KEY (tables_target) REFERENCES tables (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE utilisateurs_tables DROP CONSTRAINT FK_A9A665291E969C5'); + $this->addSql('ALTER TABLE utilisateurs_tables DROP CONSTRAINT FK_A9A6652985405FD2'); + $this->addSql('DROP TABLE utilisateurs_tables'); + } +} diff --git a/migrations/Version20241017141858.php b/migrations/Version20241017141858.php new file mode 100644 index 0000000..96512d3 --- /dev/null +++ b/migrations/Version20241017141858.php @@ -0,0 +1,38 @@ +addSql('ALTER TABLE commandes ADD statut_commande_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE commandes ADD CONSTRAINT FK_35D4282CFB435DFD FOREIGN KEY (statut_commande_id) REFERENCES statut_commandes (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('CREATE INDEX IDX_35D4282CFB435DFD ON commandes (statut_commande_id)'); + $this->addSql('ALTER TABLE statut_commandes RENAME COLUMN libellé TO libelle'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('ALTER TABLE statut_commandes RENAME COLUMN libelle TO "libellé"'); + $this->addSql('ALTER TABLE commandes DROP CONSTRAINT FK_35D4282CFB435DFD'); + $this->addSql('DROP INDEX IDX_35D4282CFB435DFD'); + $this->addSql('ALTER TABLE commandes DROP statut_commande_id'); + } +} diff --git a/migrations/Version20241017142439.php b/migrations/Version20241017142439.php new file mode 100644 index 0000000..b110121 --- /dev/null +++ b/migrations/Version20241017142439.php @@ -0,0 +1,36 @@ +addSql('ALTER TABLE commandes DROP CONSTRAINT fk_35d4282cfb435dfd'); + $this->addSql('DROP INDEX idx_35d4282cfb435dfd'); + $this->addSql('ALTER TABLE commandes DROP statut_commande_id'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('ALTER TABLE commandes ADD statut_commande_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE commandes ADD CONSTRAINT fk_35d4282cfb435dfd FOREIGN KEY (statut_commande_id) REFERENCES statut_commandes (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('CREATE INDEX idx_35d4282cfb435dfd ON commandes (statut_commande_id)'); + } +} diff --git a/migrations/Version20241017142915.php b/migrations/Version20241017142915.php new file mode 100644 index 0000000..eb4ad87 --- /dev/null +++ b/migrations/Version20241017142915.php @@ -0,0 +1,42 @@ +addSql('ALTER TABLE commandes ADD statut_commande_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE commandes ADD CONSTRAINT FK_35D4282CFB435DFD FOREIGN KEY (statut_commande_id) REFERENCES statut_commandes (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('CREATE INDEX IDX_35D4282CFB435DFD ON commandes (statut_commande_id)'); + $this->addSql('ALTER TABLE statut_commandes DROP CONSTRAINT fk_947abdee82ea2e54'); + $this->addSql('DROP INDEX idx_947abdee82ea2e54'); + $this->addSql('ALTER TABLE statut_commandes DROP commande_id'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('ALTER TABLE statut_commandes ADD commande_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE statut_commandes ADD CONSTRAINT fk_947abdee82ea2e54 FOREIGN KEY (commande_id) REFERENCES commandes (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('CREATE INDEX idx_947abdee82ea2e54 ON statut_commandes (commande_id)'); + $this->addSql('ALTER TABLE commandes DROP CONSTRAINT FK_35D4282CFB435DFD'); + $this->addSql('DROP INDEX IDX_35D4282CFB435DFD'); + $this->addSql('ALTER TABLE commandes DROP statut_commande_id'); + } +} diff --git a/src/Entity/Clients.php b/src/Entity/Clients.php index 179d8a5..a42c5c2 100644 --- a/src/Entity/Clients.php +++ b/src/Entity/Clients.php @@ -33,9 +33,16 @@ class Clients #[ORM\ManyToMany(targetEntity: Tables::class, inversedBy: 'Tabl')] private Collection $Tabl; + /** + * @var Collection + */ + #[ORM\ManyToMany(targetEntity: Commandes::class, mappedBy: 'Client')] + private Collection $commandes; + public function __construct() { $this->Tabl = new ArrayCollection(); + $this->commandes = new ArrayCollection(); } public function getId(): ?int @@ -114,4 +121,31 @@ class Clients return $this; } + + /** + * @return Collection + */ + public function getCommandes(): Collection + { + return $this->commandes; + } + + public function addCommande(Commandes $commande): static + { + if (!$this->commandes->contains($commande)) { + $this->commandes->add($commande); + $commande->addClient($this); + } + + return $this; + } + + public function removeCommande(Commandes $commande): static + { + if ($this->commandes->removeElement($commande)) { + $commande->removeClient($this); + } + + return $this; + } } diff --git a/src/Entity/Commandes.php b/src/Entity/Commandes.php new file mode 100644 index 0000000..84dbde5 --- /dev/null +++ b/src/Entity/Commandes.php @@ -0,0 +1,189 @@ + + */ + #[ORM\ManyToMany(targetEntity: Clients::class, inversedBy: 'commandes')] + private Collection $Client; + + /** + * @var Collection + */ + #[ORM\OneToMany(targetEntity: DetailsCommande::class, mappedBy: 'Commande')] + private Collection $detailsCommandes; + + /** + * @var Collection + */ + #[ORM\ManyToMany(targetEntity: Plats::class, mappedBy: 'Commande')] + private Collection $plats; + + #[ORM\ManyToOne(inversedBy: 'commandes')] + private ?StatutCommandes $StatutCommande = null; + + public function __construct() + { + $this->Client = new ArrayCollection(); + $this->detailsCommandes = new ArrayCollection(); + $this->plats = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getDateHeure(): ?\DateTimeInterface + { + return $this->DateHeure; + } + + public function setDateHeure(\DateTimeInterface $DateHeure): static + { + $this->DateHeure = $DateHeure; + + return $this; + } + + public function isStatut(): ?bool + { + return $this->Statut; + } + + public function setStatut(bool $Statut): static + { + $this->Statut = $Statut; + + return $this; + } + + public function getTotal(): ?float + { + return $this->Total; + } + + public function setTotal(float $Total): static + { + $this->Total = $Total; + + return $this; + } + + /** + * @return Collection + */ + public function getClient(): Collection + { + return $this->Client; + } + + public function addClient(Clients $client): static + { + if (!$this->Client->contains($client)) { + $this->Client->add($client); + } + + return $this; + } + + public function removeClient(Clients $client): static + { + $this->Client->removeElement($client); + + return $this; + } + + /** + * @return Collection + */ + public function getDetailsCommandes(): Collection + { + return $this->detailsCommandes; + } + + public function addDetailsCommande(DetailsCommande $detailsCommande): static + { + if (!$this->detailsCommandes->contains($detailsCommande)) { + $this->detailsCommandes->add($detailsCommande); + $detailsCommande->setCommande($this); + } + + return $this; + } + + public function removeDetailsCommande(DetailsCommande $detailsCommande): static + { + if ($this->detailsCommandes->removeElement($detailsCommande)) { + // set the owning side to null (unless already changed) + if ($detailsCommande->getCommande() === $this) { + $detailsCommande->setCommande(null); + } + } + + return $this; + } + + /** + * @return Collection + */ + public function getPlats(): Collection + { + return $this->plats; + } + + public function addPlat(Plats $plat): static + { + if (!$this->plats->contains($plat)) { + $this->plats->add($plat); + $plat->addCommande($this); + } + + return $this; + } + + public function removePlat(Plats $plat): static + { + if ($this->plats->removeElement($plat)) { + $plat->removeCommande($this); + } + + return $this; + } + + public function getStatutCommande(): ?StatutCommandes + { + return $this->StatutCommande; + } + + public function setStatutCommande(?StatutCommandes $StatutCommande): static + { + $this->StatutCommande = $StatutCommande; + + return $this; + } +} diff --git a/src/Entity/DetailsCommande.php b/src/Entity/DetailsCommande.php new file mode 100644 index 0000000..ce4c5af --- /dev/null +++ b/src/Entity/DetailsCommande.php @@ -0,0 +1,65 @@ +id; + } + + public function getQuantite(): ?int + { + return $this->Quantite; + } + + public function setQuantite(int $Quantite): static + { + $this->Quantite = $Quantite; + + return $this; + } + + public function getPrixUnitaire(): ?float + { + return $this->PrixUnitaire; + } + + public function setPrixUnitaire(float $PrixUnitaire): static + { + $this->PrixUnitaire = $PrixUnitaire; + + return $this; + } + + public function getCommande(): ?Commandes + { + return $this->Commande; + } + + public function setCommande(?Commandes $Commande): static + { + $this->Commande = $Commande; + + return $this; + } +} diff --git a/src/Entity/Plats.php b/src/Entity/Plats.php new file mode 100644 index 0000000..5515a14 --- /dev/null +++ b/src/Entity/Plats.php @@ -0,0 +1,162 @@ + + */ + #[ORM\ManyToMany(targetEntity: Commandes::class, inversedBy: 'plats')] + private Collection $Commande; + + #[ORM\ManyToOne(inversedBy: 'plats')] + private ?Reductions $Reduction = null; + + public function __construct() + { + $this->Commande = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getNom(): ?string + { + return $this->Nom; + } + + public function setNom(string $Nom): static + { + $this->Nom = $Nom; + + return $this; + } + + public function getDescription(): ?string + { + return $this->Description; + } + + public function setDescription(string $Description): static + { + $this->Description = $Description; + + return $this; + } + + public function getPrix(): ?float + { + return $this->Prix; + } + + public function setPrix(float $Prix): static + { + $this->Prix = $Prix; + + return $this; + } + + public function getCategorie(): ?string + { + return $this->Categorie; + } + + public function setCategorie(string $Categorie): static + { + $this->Categorie = $Categorie; + + return $this; + } + + public function isStatut(): ?bool + { + return $this->Statut; + } + + public function setStatut(bool $Statut): static + { + $this->Statut = $Statut; + + return $this; + } + + public function getNbDeCommande(): ?int + { + return $this->Nb_de_commande; + } + + public function setNbDeCommande(int $Nb_de_commande): static + { + $this->Nb_de_commande = $Nb_de_commande; + + return $this; + } + + /** + * @return Collection + */ + public function getCommande(): Collection + { + return $this->Commande; + } + + public function addCommande(Commandes $commande): static + { + if (!$this->Commande->contains($commande)) { + $this->Commande->add($commande); + } + + return $this; + } + + public function removeCommande(Commandes $commande): static + { + $this->Commande->removeElement($commande); + + return $this; + } + + public function getReduction(): ?Reductions + { + return $this->Reduction; + } + + public function setReduction(?Reductions $Reduction): static + { + $this->Reduction = $Reduction; + + return $this; + } +} diff --git a/src/Entity/Reductions.php b/src/Entity/Reductions.php new file mode 100644 index 0000000..ed93d26 --- /dev/null +++ b/src/Entity/Reductions.php @@ -0,0 +1,154 @@ + + */ + #[ORM\OneToMany(targetEntity: Plats::class, mappedBy: 'Reduction')] + private Collection $plats; + + public function __construct() + { + $this->plats = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getDescription(): ?string + { + return $this->Description; + } + + public function setDescription(string $Description): static + { + $this->Description = $Description; + + return $this; + } + + public function getPrix(): ?float + { + return $this->Prix; + } + + public function setPrix(float $Prix): static + { + $this->Prix = $Prix; + + return $this; + } + + public function getPourcentage(): ?int + { + return $this->Pourcentage; + } + + public function setPourcentage(int $Pourcentage): static + { + $this->Pourcentage = $Pourcentage; + + return $this; + } + + public function getMontantFixe(): ?string + { + return $this->MontantFixe; + } + + public function setMontantFixe(string $MontantFixe): static + { + $this->MontantFixe = $MontantFixe; + + return $this; + } + + public function getDateDebut(): ?\DateTimeInterface + { + return $this->DateDebut; + } + + public function setDateDebut(\DateTimeInterface $DateDebut): static + { + $this->DateDebut = $DateDebut; + + return $this; + } + + public function getDateFin(): ?\DateTimeInterface + { + return $this->DateFin; + } + + public function setDateFin(\DateTimeInterface $DateFin): static + { + $this->DateFin = $DateFin; + + return $this; + } + + /** + * @return Collection + */ + public function getPlats(): Collection + { + return $this->plats; + } + + public function addPlat(Plats $plat): static + { + if (!$this->plats->contains($plat)) { + $this->plats->add($plat); + $plat->setReduction($this); + } + + return $this; + } + + public function removePlat(Plats $plat): static + { + if ($this->plats->removeElement($plat)) { + // set the owning side to null (unless already changed) + if ($plat->getReduction() === $this) { + $plat->setReduction(null); + } + } + + return $this; + } +} diff --git a/src/Entity/StatutCommandes.php b/src/Entity/StatutCommandes.php new file mode 100644 index 0000000..fb1730d --- /dev/null +++ b/src/Entity/StatutCommandes.php @@ -0,0 +1,78 @@ + + */ + #[ORM\OneToMany(targetEntity: Commandes::class, mappedBy: 'StatutCommande')] + private Collection $commandes; + + public function __construct() + { + $this->commandes = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getLibelle(): ?string + { + return $this->Libelle; + } + + public function setLibelle(string $Libelle): static + { + $this->Libelle = $Libelle; + + return $this; + } + + /** + * @return Collection + */ + public function getCommandes(): Collection + { + return $this->commandes; + } + + public function addCommande(Commandes $commande): static + { + if (!$this->commandes->contains($commande)) { + $this->commandes->add($commande); + $commande->setStatutCommande($this); + } + + return $this; + } + + public function removeCommande(Commandes $commande): static + { + if ($this->commandes->removeElement($commande)) { + // set the owning side to null (unless already changed) + if ($commande->getStatutCommande() === $this) { + $commande->setStatutCommande(null); + } + } + + return $this; + } +} diff --git a/src/Entity/StatutTables.php b/src/Entity/StatutTables.php new file mode 100644 index 0000000..de6d4af --- /dev/null +++ b/src/Entity/StatutTables.php @@ -0,0 +1,50 @@ +id; + } + + public function getLibellé(): ?string + { + return $this->Libellé; + } + + public function setLibellé(string $Libellé): static + { + $this->Libellé = $Libellé; + + return $this; + } + + public function getTabl(): ?Tables + { + return $this->Tabl; + } + + public function setTabl(?Tables $Tabl): static + { + $this->Tabl = $Tabl; + + return $this; + } +} diff --git a/src/Entity/Tables.php b/src/Entity/Tables.php index 548d631..96c66d2 100644 --- a/src/Entity/Tables.php +++ b/src/Entity/Tables.php @@ -19,7 +19,7 @@ class Tables * @var Collection */ #[ORM\ManyToMany(targetEntity: Clients::class, mappedBy: 'Tabl')] - private Collection $Tabl; + private Collection $Clients; /** * @var Collection @@ -27,10 +27,24 @@ class Tables #[ORM\OneToMany(targetEntity: Reservations::class, mappedBy: 'Tabl')] private Collection $reservations; + /** + * @var Collection + */ + #[ORM\OneToMany(targetEntity: StatutTables::class, mappedBy: 'Tabl')] + private Collection $statutTables; + + /** + * @var Collection + */ + #[ORM\ManyToMany(targetEntity: Utilisateurs::class, mappedBy: 'tabl')] + private Collection $utilisateurs; + public function __construct() { - $this->Tabl = new ArrayCollection(); + $this->Clients = new ArrayCollection(); $this->reservations = new ArrayCollection(); + $this->statutTables = new ArrayCollection(); + $this->utilisateurs = new ArrayCollection(); } public function getId(): ?int @@ -41,24 +55,24 @@ class Tables /** * @return Collection */ - public function getTabl(): Collection + public function getClient(): Collection { - return $this->Tabl; + return $this->Clients; } - public function addTabl(Clients $tabl): static + public function addClient(Clients $tabl): static { - if (!$this->Tabl->contains($tabl)) { - $this->Tabl->add($tabl); + if (!$this->Clients->contains($tabl)) { + $this->Clients->add($tabl); $tabl->addTabl($this); } return $this; } - public function removeTabl(Clients $tabl): static + public function removeClient(Clients $tabl): static { - if ($this->Tabl->removeElement($tabl)) { + if ($this->Clients->removeElement($tabl)) { $tabl->removeTabl($this); } @@ -94,4 +108,61 @@ 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->setTabl($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->getTabl() === $this) { + $statutTable->setTabl(null); + } + } + + return $this; + } + + /** + * @return Collection + */ + public function getUtilisateurs(): Collection + { + return $this->utilisateurs; + } + + public function addUtilisateur(Utilisateurs $utilisateur): static + { + if (!$this->utilisateurs->contains($utilisateur)) { + $this->utilisateurs->add($utilisateur); + $utilisateur->addTabl($this); + } + + return $this; + } + + public function removeUtilisateur(Utilisateurs $utilisateur): static + { + if ($this->utilisateurs->removeElement($utilisateur)) { + $utilisateur->removeTabl($this); + } + + return $this; + } } diff --git a/src/Entity/Utilisateurs.php b/src/Entity/Utilisateurs.php index 3fd6279..c1b26d6 100644 --- a/src/Entity/Utilisateurs.php +++ b/src/Entity/Utilisateurs.php @@ -36,9 +36,16 @@ class Utilisateurs #[ORM\ManyToMany(targetEntity: Reservations::class, inversedBy: 'utilisateurs')] private Collection $Reservation; + /** + * @var Collection + */ + #[ORM\ManyToMany(targetEntity: Tables::class, inversedBy: 'utilisateurs')] + private Collection $tabl; + public function __construct() { $this->Reservation = new ArrayCollection(); + $this->tabl = new ArrayCollection(); } public function getId(): ?int @@ -129,4 +136,28 @@ class Utilisateurs return $this; } + + /** + * @return Collection + */ + public function getTabl(): Collection + { + return $this->tabl; + } + + public function addTabl(Tables $tabl): static + { + if (!$this->tabl->contains($tabl)) { + $this->tabl->add($tabl); + } + + return $this; + } + + public function removeTabl(Tables $tabl): static + { + $this->tabl->removeElement($tabl); + + return $this; + } } diff --git a/src/Repository/ClientsRepository.php b/src/Repository/ClientsRepository.php new file mode 100644 index 0000000..b954fd0 --- /dev/null +++ b/src/Repository/ClientsRepository.php @@ -0,0 +1,43 @@ + + */ +class ClientsRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Clients::class); + } + +// /** +// * @return Commandes[] Returns an array of Commandes objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('c') +// ->andWhere('c.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('c.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Commandes +// { +// return $this->createQueryBuilder('c') +// ->andWhere('c.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/CommandesRepository.php b/src/Repository/CommandesRepository.php new file mode 100644 index 0000000..f65844e --- /dev/null +++ b/src/Repository/CommandesRepository.php @@ -0,0 +1,43 @@ + + */ +class CommandesRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Commandes::class); + } + +// /** +// * @return Commandes[] Returns an array of Commandes objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('c') +// ->andWhere('c.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('c.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Commandes +// { +// return $this->createQueryBuilder('c') +// ->andWhere('c.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/DetailsCommandeRepository.php b/src/Repository/DetailsCommandeRepository.php new file mode 100644 index 0000000..177685f --- /dev/null +++ b/src/Repository/DetailsCommandeRepository.php @@ -0,0 +1,43 @@ + + */ +class DetailsCommandeRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, DetailsCommande::class); + } + +// /** +// * @return DetailsCommande[] Returns an array of DetailsCommande objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('d') +// ->andWhere('d.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('d.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?DetailsCommande +// { +// return $this->createQueryBuilder('d') +// ->andWhere('d.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/PlatsRepository.php b/src/Repository/PlatsRepository.php new file mode 100644 index 0000000..a4d8cad --- /dev/null +++ b/src/Repository/PlatsRepository.php @@ -0,0 +1,43 @@ + + */ +class PlatsRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Plats::class); + } + +// /** +// * @return Plats[] Returns an array of Plats objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('p') +// ->andWhere('p.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('p.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Plats +// { +// return $this->createQueryBuilder('p') +// ->andWhere('p.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/ReductionsRepository.php b/src/Repository/ReductionsRepository.php new file mode 100644 index 0000000..e755a08 --- /dev/null +++ b/src/Repository/ReductionsRepository.php @@ -0,0 +1,43 @@ + + */ +class ReductionsRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Reductions::class); + } + +// /** +// * @return Reductions[] Returns an array of Reductions objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('r') +// ->andWhere('r.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('r.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Reductions +// { +// return $this->createQueryBuilder('r') +// ->andWhere('r.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/ReservationsRepository.php b/src/Repository/ReservationsRepository.php new file mode 100644 index 0000000..67fb065 --- /dev/null +++ b/src/Repository/ReservationsRepository.php @@ -0,0 +1,43 @@ + + */ +class ReservationsRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Reservations::class); + } + +// /** +// * @return Commandes[] Returns an array of Commandes objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('c') +// ->andWhere('c.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('c.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Commandes +// { +// return $this->createQueryBuilder('c') +// ->andWhere('c.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/StatutCommandesRepository.php b/src/Repository/StatutCommandesRepository.php new file mode 100644 index 0000000..de259ca --- /dev/null +++ b/src/Repository/StatutCommandesRepository.php @@ -0,0 +1,43 @@ + + */ +class StatutCommandesRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, StatutCommandes::class); + } + +// /** +// * @return StatutCommandes[] Returns an array of StatutCommandes 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): ?StatutCommandes +// { +// return $this->createQueryBuilder('s') +// ->andWhere('s.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/StatutTablesRepository.php b/src/Repository/StatutTablesRepository.php new file mode 100644 index 0000000..b44f045 --- /dev/null +++ b/src/Repository/StatutTablesRepository.php @@ -0,0 +1,43 @@ + + */ +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/src/Repository/TablesRepository.php b/src/Repository/TablesRepository.php new file mode 100644 index 0000000..b676813 --- /dev/null +++ b/src/Repository/TablesRepository.php @@ -0,0 +1,43 @@ + + */ +class TablesRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Tables::class); + } + +// /** +// * @return Commandes[] Returns an array of Commandes objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('c') +// ->andWhere('c.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('c.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Commandes +// { +// return $this->createQueryBuilder('c') +// ->andWhere('c.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/src/Repository/UtilisateursRepository.php b/src/Repository/UtilisateursRepository.php new file mode 100644 index 0000000..958e284 --- /dev/null +++ b/src/Repository/UtilisateursRepository.php @@ -0,0 +1,43 @@ + + */ +class UtilisateursRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Utilisateurs::class); + } + +// /** +// * @return Commandes[] Returns an array of Commandes objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('c') +// ->andWhere('c.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('c.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Commandes +// { +// return $this->createQueryBuilder('c') +// ->andWhere('c.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +}