From 29b4c055b5be3f247f86126f7012aa36332de257 Mon Sep 17 00:00:00 2001 From: bayard Date: Thu, 26 Sep 2024 17:40:10 +0200 Subject: [PATCH 01/20] Release Migration --- src/Controller/IndexController.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/Controller/IndexController.php diff --git a/src/Controller/IndexController.php b/src/Controller/IndexController.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/src/Controller/IndexController.php @@ -0,0 +1 @@ + Date: Thu, 3 Oct 2024 17:25:40 +0200 Subject: [PATCH 02/20] Supprimer .idea/FestinHegre.iml --- .idea/FestinHegre.iml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .idea/FestinHegre.iml diff --git a/.idea/FestinHegre.iml b/.idea/FestinHegre.iml deleted file mode 100644 index c956989..0000000 --- a/.idea/FestinHegre.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file From 254248d2fc340de1c9ede69e943288ad86bd1cde Mon Sep 17 00:00:00 2001 From: tinkal Date: Thu, 3 Oct 2024 17:36:51 +0200 Subject: [PATCH 03/20] Supprimer .idea/.gitignore --- .idea/.gitignore | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .idea/.gitignore diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml From 753f9522d52920ae87c187c2b40a8d97e104ddbf Mon Sep 17 00:00:00 2001 From: tinkal Date: Thu, 3 Oct 2024 17:36:54 +0200 Subject: [PATCH 04/20] Supprimer .idea/modules.xml --- .idea/modules.xml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .idea/modules.xml diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 31ac1f1..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file From a0382404b8a33f22ca8e41883c7a9b674b5ec68e Mon Sep 17 00:00:00 2001 From: tinkal Date: Thu, 3 Oct 2024 17:36:57 +0200 Subject: [PATCH 05/20] Supprimer .idea/php.xml --- .idea/php.xml | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 .idea/php.xml diff --git a/.idea/php.xml b/.idea/php.xml deleted file mode 100644 index d238ceb..0000000 --- a/.idea/php.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From f8b9a4651820dce07fa16544e2e1a5b3826272c3 Mon Sep 17 00:00:00 2001 From: tinkal Date: Thu, 3 Oct 2024 17:37:01 +0200 Subject: [PATCH 06/20] Supprimer .idea/phpunit.xml --- .idea/phpunit.xml | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 .idea/phpunit.xml diff --git a/.idea/phpunit.xml b/.idea/phpunit.xml deleted file mode 100644 index 4f8104c..0000000 --- a/.idea/phpunit.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file From ce4054eadb1503dcb66edddb3c5a794f5fb06792 Mon Sep 17 00:00:00 2001 From: tinkal Date: Thu, 3 Oct 2024 17:37:04 +0200 Subject: [PATCH 07/20] Supprimer .idea/vcs.xml --- .idea/vcs.xml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .idea/vcs.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 6152eead2555fe5e627ef86a4f0635f769beb3ee Mon Sep 17 00:00:00 2001 From: Joshua Date: Thu, 3 Oct 2024 17:37:43 +0200 Subject: [PATCH 08/20] Sup .idea de mort --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8d4f2f1..18baddc 100644 --- a/.gitignore +++ b/.gitignore @@ -187,3 +187,4 @@ fabric.properties /web/js/ # End of https://www.toptal.com/developers/gitignore/api/symfony,phpstorm,git +.idea/ \ No newline at end of file From 7003883db4abe22a8e5abc176977f5ffa6216f5f Mon Sep 17 00:00:00 2001 From: Joshua Date: Thu, 3 Oct 2024 17:44:36 +0200 Subject: [PATCH 09/20] Sup vendor --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 18baddc..4a2bba8 100644 --- a/.gitignore +++ b/.gitignore @@ -187,4 +187,5 @@ fabric.properties /web/js/ # End of https://www.toptal.com/developers/gitignore/api/symfony,phpstorm,git -.idea/ \ No newline at end of file +.idea/ +/vendor/ \ No newline at end of file From dea68643b130c700aeb90069042a090c4846a85e Mon Sep 17 00:00:00 2001 From: bayardk Date: Thu, 3 Oct 2024 17:53:21 +0200 Subject: [PATCH 10/20] Supprimer .idea/.gitignore --- .idea/.gitignore | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .idea/.gitignore diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml From 0fdbe7bfb90ca0ea82f4131440c55b05f04a3303 Mon Sep 17 00:00:00 2001 From: bayardk Date: Thu, 3 Oct 2024 17:53:24 +0200 Subject: [PATCH 11/20] Supprimer .idea/FestinHegre.iml --- .idea/FestinHegre.iml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .idea/FestinHegre.iml diff --git a/.idea/FestinHegre.iml b/.idea/FestinHegre.iml deleted file mode 100644 index c956989..0000000 --- a/.idea/FestinHegre.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file From 40ef45a51013cebfdfecba32f706baaaf2ef2c78 Mon Sep 17 00:00:00 2001 From: bayardk Date: Thu, 3 Oct 2024 17:53:27 +0200 Subject: [PATCH 12/20] Supprimer .idea/modules.xml --- .idea/modules.xml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .idea/modules.xml diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 31ac1f1..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file From fcb7e18ff9dc7c7a961f92121e194dd20bf8c576 Mon Sep 17 00:00:00 2001 From: bayardk Date: Thu, 3 Oct 2024 17:53:31 +0200 Subject: [PATCH 13/20] Supprimer .idea/php.xml --- .idea/php.xml | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 .idea/php.xml diff --git a/.idea/php.xml b/.idea/php.xml deleted file mode 100644 index d238ceb..0000000 --- a/.idea/php.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From ab008f86aafb6f3f0859c2e7c936777658a9e840 Mon Sep 17 00:00:00 2001 From: bayardk Date: Thu, 3 Oct 2024 17:53:34 +0200 Subject: [PATCH 14/20] Supprimer .idea/phpunit.xml --- .idea/phpunit.xml | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 .idea/phpunit.xml diff --git a/.idea/phpunit.xml b/.idea/phpunit.xml deleted file mode 100644 index 4f8104c..0000000 --- a/.idea/phpunit.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file From 8620df27fa883317075414e3d562cecd76011521 Mon Sep 17 00:00:00 2001 From: bayardk Date: Thu, 3 Oct 2024 17:53:37 +0200 Subject: [PATCH 15/20] Supprimer .idea/vcs.xml --- .idea/vcs.xml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .idea/vcs.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 6d8f6de9d1b91e86aaf583e754f5e1ac06c99c24 Mon Sep 17 00:00:00 2001 From: bayard Date: Thu, 3 Oct 2024 17:55:39 +0200 Subject: [PATCH 16/20] Push Migration et Entity + gitignore vendor + idea --- .env.local | 41 ++++++ .gitignore | 2 + migrations/Version20241003154825.php | 181 +++++++++++++++++++++++++++ src/Entity/Customer.php | 86 +++++++++++++ src/Entity/Discount.php | 100 +++++++++++++++ src/Entity/Dishes.php | 103 +++++++++++++++ src/Entity/Eat.php | 20 +++ src/Entity/Have.php | 20 +++ src/Entity/Order.php | 81 ++++++++++++ src/Entity/OrderDetail.php | 55 ++++++++ src/Entity/Ordering.php | 20 +++ src/Entity/Reservation.php | 56 +++++++++ src/Entity/Reserve.php | 20 +++ src/Entity/StatusOrder.php | 40 ++++++ src/Entity/StatusTable.php | 40 ++++++ src/Entity/Table.php | 40 ++++++ src/Entity/User.php | 103 +++++++++++++++ 17 files changed, 1008 insertions(+) create mode 100644 .env.local create mode 100644 migrations/Version20241003154825.php create mode 100644 src/Entity/Customer.php create mode 100644 src/Entity/Discount.php create mode 100644 src/Entity/Dishes.php create mode 100644 src/Entity/Eat.php create mode 100644 src/Entity/Have.php create mode 100644 src/Entity/Order.php create mode 100644 src/Entity/OrderDetail.php create mode 100644 src/Entity/Ordering.php create mode 100644 src/Entity/Reservation.php create mode 100644 src/Entity/Reserve.php create mode 100644 src/Entity/StatusOrder.php create mode 100644 src/Entity/StatusTable.php create mode 100644 src/Entity/Table.php create mode 100644 src/Entity/User.php diff --git a/.env.local b/.env.local new file mode 100644 index 0000000..bd51528 --- /dev/null +++ b/.env.local @@ -0,0 +1,41 @@ +# In all environments, the following files are loaded if they exist, +# the latter taking precedence over the former: +# +# * .env contains default values for the environment variables needed by the app +# * .env.local uncommitted file with local overrides +# * .env.$APP_ENV committed environment-specific defaults +# * .env.$APP_ENV.local uncommitted environment-specific overrides +# +# Real environment variables win over .env files. +# +# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES. +# https://symfony.com/doc/current/configuration/secrets.html +# +# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2). +# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration + +###> symfony/framework-bundle ### +APP_ENV=dev +APP_SECRET=36d6a0fd0e8606a88d3cc51aed9e3dc5 +###< symfony/framework-bundle ### + +###> doctrine/doctrine-bundle ### +# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url +# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml +# +# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db" +# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4" +# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4" +DATABASE_URL="postgresql://bayardk:Btssio2024@172.20.96.1:5432/festinhegre?serverVersion=16&charset=utf8" +###< doctrine/doctrine-bundle ### + +###> symfony/messenger ### +# Choose one of the transports below +# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages +# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages +MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 +###< symfony/messenger ### + +###> symfony/mailer ### +# MAILER_DSN=null://null +###< symfony/mailer ### diff --git a/.gitignore b/.gitignore index 8d4f2f1..4a2bba8 100644 --- a/.gitignore +++ b/.gitignore @@ -187,3 +187,5 @@ fabric.properties /web/js/ # End of https://www.toptal.com/developers/gitignore/api/symfony,phpstorm,git +.idea/ +/vendor/ \ No newline at end of file diff --git a/migrations/Version20241003154825.php b/migrations/Version20241003154825.php new file mode 100644 index 0000000..f56571c --- /dev/null +++ b/migrations/Version20241003154825.php @@ -0,0 +1,181 @@ +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 eat_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE have_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 ordering_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 reserve_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('CREATE TABLE customer (id INT NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, phone_number VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE customer_order (customer_id INT NOT NULL, order_id INT NOT NULL, PRIMARY KEY(customer_id, order_id))'); + $this->addSql('CREATE INDEX IDX_3B1CE6A39395C3F3 ON customer_order (customer_id)'); + $this->addSql('CREATE INDEX IDX_3B1CE6A38D9F6D38 ON customer_order (order_id)'); + $this->addSql('CREATE TABLE customer_table (customer_id INT NOT NULL, table_id INT NOT NULL, PRIMARY KEY(customer_id, table_id))'); + $this->addSql('CREATE INDEX IDX_381CFA7D9395C3F3 ON customer_table (customer_id)'); + $this->addSql('CREATE INDEX IDX_381CFA7DECFF285C ON customer_table (table_id)'); + $this->addSql('CREATE TABLE discount (id INT NOT NULL, dish_id INT DEFAULT NULL, description VARCHAR(255) NOT NULL, percentage VARCHAR(255) NOT NULL, fixed_amount DOUBLE PRECISION NOT NULL, start_date DATE NOT NULL, end_date DATE NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_E1E0B40E148EB0CB ON discount (dish_id)'); + $this->addSql('CREATE TABLE dishes (id INT NOT NULL, name VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, price DOUBLE PRECISION NOT NULL, status VARCHAR(255) NOT NULL, number_order VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE dishes_order (dishes_id INT NOT NULL, order_id INT NOT NULL, PRIMARY KEY(dishes_id, order_id))'); + $this->addSql('CREATE INDEX IDX_A859E4CA05DD37A ON dishes_order (dishes_id)'); + $this->addSql('CREATE INDEX IDX_A859E4C8D9F6D38 ON dishes_order (order_id)'); + $this->addSql('CREATE TABLE eat (id INT NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE have (id INT NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE "order" (id INT NOT NULL, order_detail_id INT DEFAULT NULL, status_orders_id INT DEFAULT NULL, date_heure DATE NOT NULL, status_order VARCHAR(255) NOT NULL, price_order VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_F529939864577843 ON "order" (order_detail_id)'); + $this->addSql('CREATE INDEX IDX_F5299398476B1A97 ON "order" (status_orders_id)'); + $this->addSql('CREATE TABLE order_dishes (order_id INT NOT NULL, dishes_id INT NOT NULL, PRIMARY KEY(order_id, dishes_id))'); + $this->addSql('CREATE INDEX IDX_9BC2C3888D9F6D38 ON order_dishes (order_id)'); + $this->addSql('CREATE INDEX IDX_9BC2C388A05DD37A ON order_dishes (dishes_id)'); + $this->addSql('CREATE TABLE order_customer (order_id INT NOT NULL, customer_id INT NOT NULL, PRIMARY KEY(order_id, customer_id))'); + $this->addSql('CREATE INDEX IDX_60C16CB88D9F6D38 ON order_customer (order_id)'); + $this->addSql('CREATE INDEX IDX_60C16CB89395C3F3 ON order_customer (customer_id)'); + $this->addSql('CREATE TABLE order_detail (id INT NOT NULL, quantity INT NOT NULL, unitary_price VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE ordering (id INT NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE reservation (id INT NOT NULL, date_heure DATE NOT NULL, number_customer INT NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE reserve (id INT NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE status_order (id INT NOT NULL, status_order VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE status_table (id INT NOT NULL, status VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE "table" (id INT NOT NULL, status_table_id INT DEFAULT NULL, reservation_id INT DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_F6298F4671258F84 ON "table" (status_table_id)'); + $this->addSql('CREATE INDEX IDX_F6298F46B83297E7 ON "table" (reservation_id)'); + $this->addSql('CREATE TABLE table_customer (table_id INT NOT NULL, customer_id INT NOT NULL, PRIMARY KEY(table_id, customer_id))'); + $this->addSql('CREATE INDEX IDX_1184A0D9ECFF285C ON table_customer (table_id)'); + $this->addSql('CREATE INDEX IDX_1184A0D99395C3F3 ON table_customer (customer_id)'); + $this->addSql('CREATE TABLE table_user (table_id INT NOT NULL, user_id INT NOT NULL, PRIMARY KEY(table_id, user_id))'); + $this->addSql('CREATE INDEX IDX_C7459682ECFF285C ON table_user (table_id)'); + $this->addSql('CREATE INDEX IDX_C7459682A76ED395 ON table_user (user_id)'); + $this->addSql('CREATE TABLE "user" (id INT NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, mail VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, role VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE user_reservation (user_id INT NOT NULL, reservation_id INT NOT NULL, PRIMARY KEY(user_id, reservation_id))'); + $this->addSql('CREATE INDEX IDX_EBD380C0A76ED395 ON user_reservation (user_id)'); + $this->addSql('CREATE INDEX IDX_EBD380C0B83297E7 ON user_reservation (reservation_id)'); + $this->addSql('CREATE TABLE messenger_messages (id BIGSERIAL NOT NULL, body TEXT NOT NULL, headers TEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, available_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, delivered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_75EA56E0FB7336F0 ON messenger_messages (queue_name)'); + $this->addSql('CREATE INDEX IDX_75EA56E0E3BD61CE ON messenger_messages (available_at)'); + $this->addSql('CREATE INDEX IDX_75EA56E016BA31DB ON messenger_messages (delivered_at)'); + $this->addSql('COMMENT ON COLUMN messenger_messages.created_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN messenger_messages.available_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN messenger_messages.delivered_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('CREATE OR REPLACE FUNCTION notify_messenger_messages() RETURNS TRIGGER AS $$ + BEGIN + PERFORM pg_notify(\'messenger_messages\', NEW.queue_name::text); + RETURN NEW; + END; + $$ LANGUAGE plpgsql;'); + $this->addSql('DROP TRIGGER IF EXISTS notify_trigger ON messenger_messages;'); + $this->addSql('CREATE TRIGGER notify_trigger AFTER INSERT OR UPDATE ON messenger_messages FOR EACH ROW EXECUTE PROCEDURE notify_messenger_messages();'); + $this->addSql('ALTER TABLE customer_order ADD CONSTRAINT FK_3B1CE6A39395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE customer_order ADD CONSTRAINT FK_3B1CE6A38D9F6D38 FOREIGN KEY (order_id) REFERENCES "order" (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE customer_table ADD CONSTRAINT FK_381CFA7D9395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE customer_table ADD CONSTRAINT FK_381CFA7DECFF285C FOREIGN KEY (table_id) REFERENCES "table" (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE discount ADD CONSTRAINT FK_E1E0B40E148EB0CB FOREIGN KEY (dish_id) REFERENCES dishes (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE dishes_order ADD CONSTRAINT FK_A859E4CA05DD37A FOREIGN KEY (dishes_id) REFERENCES dishes (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE dishes_order ADD CONSTRAINT FK_A859E4C8D9F6D38 FOREIGN KEY (order_id) REFERENCES "order" (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE "order" ADD CONSTRAINT FK_F529939864577843 FOREIGN KEY (order_detail_id) REFERENCES order_detail (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE "order" ADD CONSTRAINT FK_F5299398476B1A97 FOREIGN KEY (status_orders_id) REFERENCES status_order (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE order_dishes ADD CONSTRAINT FK_9BC2C3888D9F6D38 FOREIGN KEY (order_id) REFERENCES "order" (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE order_dishes ADD CONSTRAINT FK_9BC2C388A05DD37A FOREIGN KEY (dishes_id) REFERENCES dishes (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE order_customer ADD CONSTRAINT FK_60C16CB88D9F6D38 FOREIGN KEY (order_id) REFERENCES "order" (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE order_customer ADD CONSTRAINT FK_60C16CB89395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE "table" ADD CONSTRAINT FK_F6298F4671258F84 FOREIGN KEY (status_table_id) REFERENCES status_table (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE "table" ADD CONSTRAINT FK_F6298F46B83297E7 FOREIGN KEY (reservation_id) REFERENCES reservation (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE table_customer ADD CONSTRAINT FK_1184A0D9ECFF285C FOREIGN KEY (table_id) REFERENCES "table" (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE table_customer ADD CONSTRAINT FK_1184A0D99395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE table_user ADD CONSTRAINT FK_C7459682ECFF285C FOREIGN KEY (table_id) REFERENCES "table" (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE table_user ADD CONSTRAINT FK_C7459682A76ED395 FOREIGN KEY (user_id) REFERENCES "user" (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE user_reservation ADD CONSTRAINT FK_EBD380C0A76ED395 FOREIGN KEY (user_id) REFERENCES "user" (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE user_reservation ADD CONSTRAINT FK_EBD380C0B83297E7 FOREIGN KEY (reservation_id) REFERENCES reservation (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 customer_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE discount_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE dishes_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE eat_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE have_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE "order_id_seq" CASCADE'); + $this->addSql('DROP SEQUENCE order_detail_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE ordering_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE reservation_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE reserve_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 customer_order DROP CONSTRAINT FK_3B1CE6A39395C3F3'); + $this->addSql('ALTER TABLE customer_order DROP CONSTRAINT FK_3B1CE6A38D9F6D38'); + $this->addSql('ALTER TABLE customer_table DROP CONSTRAINT FK_381CFA7D9395C3F3'); + $this->addSql('ALTER TABLE customer_table DROP CONSTRAINT FK_381CFA7DECFF285C'); + $this->addSql('ALTER TABLE discount DROP CONSTRAINT FK_E1E0B40E148EB0CB'); + $this->addSql('ALTER TABLE dishes_order DROP CONSTRAINT FK_A859E4CA05DD37A'); + $this->addSql('ALTER TABLE dishes_order DROP CONSTRAINT FK_A859E4C8D9F6D38'); + $this->addSql('ALTER TABLE "order" DROP CONSTRAINT FK_F529939864577843'); + $this->addSql('ALTER TABLE "order" DROP CONSTRAINT FK_F5299398476B1A97'); + $this->addSql('ALTER TABLE order_dishes DROP CONSTRAINT FK_9BC2C3888D9F6D38'); + $this->addSql('ALTER TABLE order_dishes DROP CONSTRAINT FK_9BC2C388A05DD37A'); + $this->addSql('ALTER TABLE order_customer DROP CONSTRAINT FK_60C16CB88D9F6D38'); + $this->addSql('ALTER TABLE order_customer DROP CONSTRAINT FK_60C16CB89395C3F3'); + $this->addSql('ALTER TABLE "table" DROP CONSTRAINT FK_F6298F4671258F84'); + $this->addSql('ALTER TABLE "table" DROP CONSTRAINT FK_F6298F46B83297E7'); + $this->addSql('ALTER TABLE table_customer DROP CONSTRAINT FK_1184A0D9ECFF285C'); + $this->addSql('ALTER TABLE table_customer DROP CONSTRAINT FK_1184A0D99395C3F3'); + $this->addSql('ALTER TABLE table_user DROP CONSTRAINT FK_C7459682ECFF285C'); + $this->addSql('ALTER TABLE table_user DROP CONSTRAINT FK_C7459682A76ED395'); + $this->addSql('ALTER TABLE user_reservation DROP CONSTRAINT FK_EBD380C0A76ED395'); + $this->addSql('ALTER TABLE user_reservation DROP CONSTRAINT FK_EBD380C0B83297E7'); + $this->addSql('DROP TABLE customer'); + $this->addSql('DROP TABLE customer_order'); + $this->addSql('DROP TABLE customer_table'); + $this->addSql('DROP TABLE discount'); + $this->addSql('DROP TABLE dishes'); + $this->addSql('DROP TABLE dishes_order'); + $this->addSql('DROP TABLE eat'); + $this->addSql('DROP TABLE have'); + $this->addSql('DROP TABLE "order"'); + $this->addSql('DROP TABLE order_dishes'); + $this->addSql('DROP TABLE order_customer'); + $this->addSql('DROP TABLE order_detail'); + $this->addSql('DROP TABLE ordering'); + $this->addSql('DROP TABLE reservation'); + $this->addSql('DROP TABLE reserve'); + $this->addSql('DROP TABLE status_order'); + $this->addSql('DROP TABLE status_table'); + $this->addSql('DROP TABLE "table"'); + $this->addSql('DROP TABLE table_customer'); + $this->addSql('DROP TABLE table_user'); + $this->addSql('DROP TABLE "user"'); + $this->addSql('DROP TABLE user_reservation'); + $this->addSql('DROP TABLE messenger_messages'); + } +} diff --git a/src/Entity/Customer.php b/src/Entity/Customer.php new file mode 100644 index 0000000..f962828 --- /dev/null +++ b/src/Entity/Customer.php @@ -0,0 +1,86 @@ +id; + } + + public function getFirstName(): ?string + { + return $this->FirstName; + } + + public function setFirstName(string $FirstName): static + { + $this->FirstName = $FirstName; + + return $this; + } + + public function getLastName(): ?string + { + return $this->LastName; + } + + public function setLastName(string $LastName): static + { + $this->LastName = $LastName; + + return $this; + } + + public function getEmail(): ?string + { + return $this->Email; + } + + public function setEmail(string $Email): static + { + $this->Email = $Email; + + return $this; + } + + public function getPhoneNumber(): ?string + { + return $this->PhoneNumber; + } + + public function setPhoneNumber(string $PhoneNumber): static + { + $this->PhoneNumber = $PhoneNumber; + + return $this; + } +} diff --git a/src/Entity/Discount.php b/src/Entity/Discount.php new file mode 100644 index 0000000..988d720 --- /dev/null +++ b/src/Entity/Discount.php @@ -0,0 +1,100 @@ +id; + } + + public function getDescription(): ?string + { + return $this->Description; + } + + public function setDescription(string $Description): static + { + $this->Description = $Description; + + return $this; + } + + public function getPercentage(): ?string + { + return $this->Percentage; + } + + public function setPercentage(string $Percentage): static + { + $this->Percentage = $Percentage; + + return $this; + } + + public function getFixedAmount(): ?float + { + return $this->FixedAmount; + } + + public function setFixedAmount(float $FixedAmount): static + { + $this->FixedAmount = $FixedAmount; + + return $this; + } + + public function getStartDate(): ?\DateTimeInterface + { + return $this->StartDate; + } + + public function setStartDate(\DateTimeInterface $StartDate): static + { + $this->StartDate = $StartDate; + + return $this; + } + + public function getEndDate(): ?\DateTimeInterface + { + return $this->EndDate; + } + + public function setEndDate(\DateTimeInterface $EndDate): static + { + $this->EndDate = $EndDate; + + return $this; + } +} diff --git a/src/Entity/Dishes.php b/src/Entity/Dishes.php new file mode 100644 index 0000000..713066a --- /dev/null +++ b/src/Entity/Dishes.php @@ -0,0 +1,103 @@ +id; + } + + public function getName(): ?string + { + return $this->Name; + } + + public function setName(string $Name): static + { + $this->Name = $Name; + + return $this; + } + + public function getDescription(): ?string + { + return $this->Description; + } + + public function setDescription(string $Description): static + { + $this->Description = $Description; + + return $this; + } + + public function getPrice(): ?float + { + return $this->Price; + } + + public function setPrice(float $Price): static + { + $this->Price = $Price; + + return $this; + } + + public function getStatus(): ?string + { + return $this->Status; + } + + public function setStatus(string $Status): static + { + $this->Status = $Status; + + return $this; + } + + public function getNumberOrder(): ?string + { + return $this->NumberOrder; + } + + public function setNumberOrder(string $NumberOrder): static + { + $this->NumberOrder = $NumberOrder; + + return $this; + } +} diff --git a/src/Entity/Eat.php b/src/Entity/Eat.php new file mode 100644 index 0000000..a7dc469 --- /dev/null +++ b/src/Entity/Eat.php @@ -0,0 +1,20 @@ +id; + } +} diff --git a/src/Entity/Have.php b/src/Entity/Have.php new file mode 100644 index 0000000..6818dcb --- /dev/null +++ b/src/Entity/Have.php @@ -0,0 +1,20 @@ +id; + } +} diff --git a/src/Entity/Order.php b/src/Entity/Order.php new file mode 100644 index 0000000..06d91ba --- /dev/null +++ b/src/Entity/Order.php @@ -0,0 +1,81 @@ +id; + } + + public function getDateHeure(): ?\DateTimeInterface + { + return $this->DateHeure; + } + + public function setDateHeure(\DateTimeInterface $DateHeure): static + { + $this->DateHeure = $DateHeure; + + return $this; + } + + public function getStatusOrder(): ?string + { + return $this->StatusOrder; + } + + public function setStatusOrder(string $StatusOrder): static + { + $this->StatusOrder = $StatusOrder; + + return $this; + } + + public function getPriceOrder(): ?string + { + return $this->PriceOrder; + } + + public function setPriceOrder(string $PriceOrder): static + { + $this->PriceOrder = $PriceOrder; + + return $this; + } +} diff --git a/src/Entity/OrderDetail.php b/src/Entity/OrderDetail.php new file mode 100644 index 0000000..e8ca11b --- /dev/null +++ b/src/Entity/OrderDetail.php @@ -0,0 +1,55 @@ +id; + } + + public function getQuantity(): ?int + { + return $this->Quantity; + } + + public function setQuantity(int $Quantity): static + { + $this->Quantity = $Quantity; + + return $this; + } + + public function getUnitaryPrice(): ?string + { + return $this->UnitaryPrice; + } + + public function setUnitaryPrice(string $UnitaryPrice): static + { + $this->UnitaryPrice = $UnitaryPrice; + + return $this; + } +} diff --git a/src/Entity/Ordering.php b/src/Entity/Ordering.php new file mode 100644 index 0000000..4933911 --- /dev/null +++ b/src/Entity/Ordering.php @@ -0,0 +1,20 @@ +id; + } +} diff --git a/src/Entity/Reservation.php b/src/Entity/Reservation.php new file mode 100644 index 0000000..a39eedc --- /dev/null +++ b/src/Entity/Reservation.php @@ -0,0 +1,56 @@ +id; + } + + public function getDateHeure(): ?\DateTimeInterface + { + return $this->DateHeure; + } + + public function setDateHeure(\DateTimeInterface $DateHeure): static + { + $this->DateHeure = $DateHeure; + + return $this; + } + + public function getNumberCustomer(): ?int + { + return $this->NumberCustomer; + } + + public function setNumberCustomer(int $NumberCustomer): static + { + $this->NumberCustomer = $NumberCustomer; + + return $this; + } +} diff --git a/src/Entity/Reserve.php b/src/Entity/Reserve.php new file mode 100644 index 0000000..dda7fcd --- /dev/null +++ b/src/Entity/Reserve.php @@ -0,0 +1,20 @@ +id; + } +} diff --git a/src/Entity/StatusOrder.php b/src/Entity/StatusOrder.php new file mode 100644 index 0000000..2d6c3c8 --- /dev/null +++ b/src/Entity/StatusOrder.php @@ -0,0 +1,40 @@ +id; + } + + public function getStatusOrder(): ?string + { + return $this->StatusOrder; + } + + public function setStatusOrder(string $StatusOrder): static + { + $this->StatusOrder = $StatusOrder; + + return $this; + } +} diff --git a/src/Entity/StatusTable.php b/src/Entity/StatusTable.php new file mode 100644 index 0000000..2631ff3 --- /dev/null +++ b/src/Entity/StatusTable.php @@ -0,0 +1,40 @@ +id; + } + + public function getStatus(): ?string + { + return $this->Status; + } + + public function setStatus(string $Status): static + { + $this->Status = $Status; + + return $this; + } +} diff --git a/src/Entity/Table.php b/src/Entity/Table.php new file mode 100644 index 0000000..2292b20 --- /dev/null +++ b/src/Entity/Table.php @@ -0,0 +1,40 @@ +id; + } +} diff --git a/src/Entity/User.php b/src/Entity/User.php new file mode 100644 index 0000000..97b5fdb --- /dev/null +++ b/src/Entity/User.php @@ -0,0 +1,103 @@ +id; + } + + public function getFirstName(): ?string + { + return $this->FirstName; + } + + public function setFirstName(string $FirstName): static + { + $this->FirstName = $FirstName; + + return $this; + } + + public function getLastName(): ?string + { + return $this->LastName; + } + + public function setLastName(string $LastName): static + { + $this->LastName = $LastName; + + return $this; + } + + public function getMail(): ?string + { + return $this->Mail; + } + + public function setMail(string $Mail): static + { + $this->Mail = $Mail; + + return $this; + } + + public function getPassword(): ?string + { + return $this->Password; + } + + public function setPassword(string $Password): static + { + $this->Password = $Password; + + return $this; + } + + public function getRole(): ?string + { + return $this->Role; + } + + public function setRole(string $Role): static + { + $this->Role = $Role; + + return $this; + } +} From ef60fa0ddfabb8d200809bd4d3475db66ea24865 Mon Sep 17 00:00:00 2001 From: bethoulevj Date: Wed, 16 Oct 2024 20:43:05 +0200 Subject: [PATCH 17/20] Test ManyToMany Gauche schema (Clients/Tables Reservations/Utilisateurs) Test ManyToOne Gauche schema (Reservations -> Tables) --- .env.local | 2 +- migrations/Version20241003154825.php | 181 --------------------------- src/Entity/Clients.php | 117 +++++++++++++++++ src/Entity/Customer.php | 86 ------------- src/Entity/Discount.php | 100 --------------- src/Entity/Dishes.php | 103 --------------- src/Entity/Eat.php | 20 --- src/Entity/Have.php | 20 --- src/Entity/Order.php | 81 ------------ src/Entity/OrderDetail.php | 55 -------- src/Entity/Ordering.php | 20 --- src/Entity/Reservation.php | 56 --------- src/Entity/Reservations.php | 106 ++++++++++++++++ src/Entity/Reserve.php | 20 --- src/Entity/StatusOrder.php | 40 ------ src/Entity/StatusTable.php | 40 ------ src/Entity/Table.php | 40 ------ src/Entity/Tables.php | 97 ++++++++++++++ src/Entity/User.php | 103 --------------- src/Entity/Utilisateurs.php | 132 +++++++++++++++++++ 20 files changed, 453 insertions(+), 966 deletions(-) delete mode 100644 migrations/Version20241003154825.php create mode 100644 src/Entity/Clients.php delete mode 100644 src/Entity/Customer.php delete mode 100644 src/Entity/Discount.php delete mode 100644 src/Entity/Dishes.php delete mode 100644 src/Entity/Eat.php delete mode 100644 src/Entity/Have.php delete mode 100644 src/Entity/Order.php delete mode 100644 src/Entity/OrderDetail.php delete mode 100644 src/Entity/Ordering.php delete mode 100644 src/Entity/Reservation.php create mode 100644 src/Entity/Reservations.php delete mode 100644 src/Entity/Reserve.php delete mode 100644 src/Entity/StatusOrder.php delete mode 100644 src/Entity/StatusTable.php delete mode 100644 src/Entity/Table.php create mode 100644 src/Entity/Tables.php delete mode 100644 src/Entity/User.php create mode 100644 src/Entity/Utilisateurs.php diff --git a/.env.local b/.env.local index bd51528..7c751c8 100644 --- a/.env.local +++ b/.env.local @@ -26,7 +26,7 @@ APP_SECRET=36d6a0fd0e8606a88d3cc51aed9e3dc5 # DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db" # DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4" # DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4" -DATABASE_URL="postgresql://bayardk:Btssio2024@172.20.96.1:5432/festinhegre?serverVersion=16&charset=utf8" +DATABASE_URL="postgresql://postgres:root@localhost:5432/festinhegre?serverVersion=16&charset=utf8" ###< doctrine/doctrine-bundle ### ###> symfony/messenger ### diff --git a/migrations/Version20241003154825.php b/migrations/Version20241003154825.php deleted file mode 100644 index f56571c..0000000 --- a/migrations/Version20241003154825.php +++ /dev/null @@ -1,181 +0,0 @@ -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 eat_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE have_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 ordering_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 reserve_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('CREATE TABLE customer (id INT NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, phone_number VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE customer_order (customer_id INT NOT NULL, order_id INT NOT NULL, PRIMARY KEY(customer_id, order_id))'); - $this->addSql('CREATE INDEX IDX_3B1CE6A39395C3F3 ON customer_order (customer_id)'); - $this->addSql('CREATE INDEX IDX_3B1CE6A38D9F6D38 ON customer_order (order_id)'); - $this->addSql('CREATE TABLE customer_table (customer_id INT NOT NULL, table_id INT NOT NULL, PRIMARY KEY(customer_id, table_id))'); - $this->addSql('CREATE INDEX IDX_381CFA7D9395C3F3 ON customer_table (customer_id)'); - $this->addSql('CREATE INDEX IDX_381CFA7DECFF285C ON customer_table (table_id)'); - $this->addSql('CREATE TABLE discount (id INT NOT NULL, dish_id INT DEFAULT NULL, description VARCHAR(255) NOT NULL, percentage VARCHAR(255) NOT NULL, fixed_amount DOUBLE PRECISION NOT NULL, start_date DATE NOT NULL, end_date DATE NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE INDEX IDX_E1E0B40E148EB0CB ON discount (dish_id)'); - $this->addSql('CREATE TABLE dishes (id INT NOT NULL, name VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, price DOUBLE PRECISION NOT NULL, status VARCHAR(255) NOT NULL, number_order VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE dishes_order (dishes_id INT NOT NULL, order_id INT NOT NULL, PRIMARY KEY(dishes_id, order_id))'); - $this->addSql('CREATE INDEX IDX_A859E4CA05DD37A ON dishes_order (dishes_id)'); - $this->addSql('CREATE INDEX IDX_A859E4C8D9F6D38 ON dishes_order (order_id)'); - $this->addSql('CREATE TABLE eat (id INT NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE have (id INT NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE "order" (id INT NOT NULL, order_detail_id INT DEFAULT NULL, status_orders_id INT DEFAULT NULL, date_heure DATE NOT NULL, status_order VARCHAR(255) NOT NULL, price_order VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE INDEX IDX_F529939864577843 ON "order" (order_detail_id)'); - $this->addSql('CREATE INDEX IDX_F5299398476B1A97 ON "order" (status_orders_id)'); - $this->addSql('CREATE TABLE order_dishes (order_id INT NOT NULL, dishes_id INT NOT NULL, PRIMARY KEY(order_id, dishes_id))'); - $this->addSql('CREATE INDEX IDX_9BC2C3888D9F6D38 ON order_dishes (order_id)'); - $this->addSql('CREATE INDEX IDX_9BC2C388A05DD37A ON order_dishes (dishes_id)'); - $this->addSql('CREATE TABLE order_customer (order_id INT NOT NULL, customer_id INT NOT NULL, PRIMARY KEY(order_id, customer_id))'); - $this->addSql('CREATE INDEX IDX_60C16CB88D9F6D38 ON order_customer (order_id)'); - $this->addSql('CREATE INDEX IDX_60C16CB89395C3F3 ON order_customer (customer_id)'); - $this->addSql('CREATE TABLE order_detail (id INT NOT NULL, quantity INT NOT NULL, unitary_price VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE ordering (id INT NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE reservation (id INT NOT NULL, date_heure DATE NOT NULL, number_customer INT NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE reserve (id INT NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE status_order (id INT NOT NULL, status_order VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE status_table (id INT NOT NULL, status VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE "table" (id INT NOT NULL, status_table_id INT DEFAULT NULL, reservation_id INT DEFAULT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE INDEX IDX_F6298F4671258F84 ON "table" (status_table_id)'); - $this->addSql('CREATE INDEX IDX_F6298F46B83297E7 ON "table" (reservation_id)'); - $this->addSql('CREATE TABLE table_customer (table_id INT NOT NULL, customer_id INT NOT NULL, PRIMARY KEY(table_id, customer_id))'); - $this->addSql('CREATE INDEX IDX_1184A0D9ECFF285C ON table_customer (table_id)'); - $this->addSql('CREATE INDEX IDX_1184A0D99395C3F3 ON table_customer (customer_id)'); - $this->addSql('CREATE TABLE table_user (table_id INT NOT NULL, user_id INT NOT NULL, PRIMARY KEY(table_id, user_id))'); - $this->addSql('CREATE INDEX IDX_C7459682ECFF285C ON table_user (table_id)'); - $this->addSql('CREATE INDEX IDX_C7459682A76ED395 ON table_user (user_id)'); - $this->addSql('CREATE TABLE "user" (id INT NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, mail VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, role VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE user_reservation (user_id INT NOT NULL, reservation_id INT NOT NULL, PRIMARY KEY(user_id, reservation_id))'); - $this->addSql('CREATE INDEX IDX_EBD380C0A76ED395 ON user_reservation (user_id)'); - $this->addSql('CREATE INDEX IDX_EBD380C0B83297E7 ON user_reservation (reservation_id)'); - $this->addSql('CREATE TABLE messenger_messages (id BIGSERIAL NOT NULL, body TEXT NOT NULL, headers TEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, available_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, delivered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE INDEX IDX_75EA56E0FB7336F0 ON messenger_messages (queue_name)'); - $this->addSql('CREATE INDEX IDX_75EA56E0E3BD61CE ON messenger_messages (available_at)'); - $this->addSql('CREATE INDEX IDX_75EA56E016BA31DB ON messenger_messages (delivered_at)'); - $this->addSql('COMMENT ON COLUMN messenger_messages.created_at IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('COMMENT ON COLUMN messenger_messages.available_at IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('COMMENT ON COLUMN messenger_messages.delivered_at IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('CREATE OR REPLACE FUNCTION notify_messenger_messages() RETURNS TRIGGER AS $$ - BEGIN - PERFORM pg_notify(\'messenger_messages\', NEW.queue_name::text); - RETURN NEW; - END; - $$ LANGUAGE plpgsql;'); - $this->addSql('DROP TRIGGER IF EXISTS notify_trigger ON messenger_messages;'); - $this->addSql('CREATE TRIGGER notify_trigger AFTER INSERT OR UPDATE ON messenger_messages FOR EACH ROW EXECUTE PROCEDURE notify_messenger_messages();'); - $this->addSql('ALTER TABLE customer_order ADD CONSTRAINT FK_3B1CE6A39395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE customer_order ADD CONSTRAINT FK_3B1CE6A38D9F6D38 FOREIGN KEY (order_id) REFERENCES "order" (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE customer_table ADD CONSTRAINT FK_381CFA7D9395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE customer_table ADD CONSTRAINT FK_381CFA7DECFF285C FOREIGN KEY (table_id) REFERENCES "table" (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE discount ADD CONSTRAINT FK_E1E0B40E148EB0CB FOREIGN KEY (dish_id) REFERENCES dishes (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE dishes_order ADD CONSTRAINT FK_A859E4CA05DD37A FOREIGN KEY (dishes_id) REFERENCES dishes (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE dishes_order ADD CONSTRAINT FK_A859E4C8D9F6D38 FOREIGN KEY (order_id) REFERENCES "order" (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE "order" ADD CONSTRAINT FK_F529939864577843 FOREIGN KEY (order_detail_id) REFERENCES order_detail (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE "order" ADD CONSTRAINT FK_F5299398476B1A97 FOREIGN KEY (status_orders_id) REFERENCES status_order (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE order_dishes ADD CONSTRAINT FK_9BC2C3888D9F6D38 FOREIGN KEY (order_id) REFERENCES "order" (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE order_dishes ADD CONSTRAINT FK_9BC2C388A05DD37A FOREIGN KEY (dishes_id) REFERENCES dishes (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE order_customer ADD CONSTRAINT FK_60C16CB88D9F6D38 FOREIGN KEY (order_id) REFERENCES "order" (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE order_customer ADD CONSTRAINT FK_60C16CB89395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE "table" ADD CONSTRAINT FK_F6298F4671258F84 FOREIGN KEY (status_table_id) REFERENCES status_table (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE "table" ADD CONSTRAINT FK_F6298F46B83297E7 FOREIGN KEY (reservation_id) REFERENCES reservation (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE table_customer ADD CONSTRAINT FK_1184A0D9ECFF285C FOREIGN KEY (table_id) REFERENCES "table" (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE table_customer ADD CONSTRAINT FK_1184A0D99395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE table_user ADD CONSTRAINT FK_C7459682ECFF285C FOREIGN KEY (table_id) REFERENCES "table" (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE table_user ADD CONSTRAINT FK_C7459682A76ED395 FOREIGN KEY (user_id) REFERENCES "user" (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE user_reservation ADD CONSTRAINT FK_EBD380C0A76ED395 FOREIGN KEY (user_id) REFERENCES "user" (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE user_reservation ADD CONSTRAINT FK_EBD380C0B83297E7 FOREIGN KEY (reservation_id) REFERENCES reservation (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 customer_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE discount_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE dishes_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE eat_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE have_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE "order_id_seq" CASCADE'); - $this->addSql('DROP SEQUENCE order_detail_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE ordering_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE reservation_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE reserve_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 customer_order DROP CONSTRAINT FK_3B1CE6A39395C3F3'); - $this->addSql('ALTER TABLE customer_order DROP CONSTRAINT FK_3B1CE6A38D9F6D38'); - $this->addSql('ALTER TABLE customer_table DROP CONSTRAINT FK_381CFA7D9395C3F3'); - $this->addSql('ALTER TABLE customer_table DROP CONSTRAINT FK_381CFA7DECFF285C'); - $this->addSql('ALTER TABLE discount DROP CONSTRAINT FK_E1E0B40E148EB0CB'); - $this->addSql('ALTER TABLE dishes_order DROP CONSTRAINT FK_A859E4CA05DD37A'); - $this->addSql('ALTER TABLE dishes_order DROP CONSTRAINT FK_A859E4C8D9F6D38'); - $this->addSql('ALTER TABLE "order" DROP CONSTRAINT FK_F529939864577843'); - $this->addSql('ALTER TABLE "order" DROP CONSTRAINT FK_F5299398476B1A97'); - $this->addSql('ALTER TABLE order_dishes DROP CONSTRAINT FK_9BC2C3888D9F6D38'); - $this->addSql('ALTER TABLE order_dishes DROP CONSTRAINT FK_9BC2C388A05DD37A'); - $this->addSql('ALTER TABLE order_customer DROP CONSTRAINT FK_60C16CB88D9F6D38'); - $this->addSql('ALTER TABLE order_customer DROP CONSTRAINT FK_60C16CB89395C3F3'); - $this->addSql('ALTER TABLE "table" DROP CONSTRAINT FK_F6298F4671258F84'); - $this->addSql('ALTER TABLE "table" DROP CONSTRAINT FK_F6298F46B83297E7'); - $this->addSql('ALTER TABLE table_customer DROP CONSTRAINT FK_1184A0D9ECFF285C'); - $this->addSql('ALTER TABLE table_customer DROP CONSTRAINT FK_1184A0D99395C3F3'); - $this->addSql('ALTER TABLE table_user DROP CONSTRAINT FK_C7459682ECFF285C'); - $this->addSql('ALTER TABLE table_user DROP CONSTRAINT FK_C7459682A76ED395'); - $this->addSql('ALTER TABLE user_reservation DROP CONSTRAINT FK_EBD380C0A76ED395'); - $this->addSql('ALTER TABLE user_reservation DROP CONSTRAINT FK_EBD380C0B83297E7'); - $this->addSql('DROP TABLE customer'); - $this->addSql('DROP TABLE customer_order'); - $this->addSql('DROP TABLE customer_table'); - $this->addSql('DROP TABLE discount'); - $this->addSql('DROP TABLE dishes'); - $this->addSql('DROP TABLE dishes_order'); - $this->addSql('DROP TABLE eat'); - $this->addSql('DROP TABLE have'); - $this->addSql('DROP TABLE "order"'); - $this->addSql('DROP TABLE order_dishes'); - $this->addSql('DROP TABLE order_customer'); - $this->addSql('DROP TABLE order_detail'); - $this->addSql('DROP TABLE ordering'); - $this->addSql('DROP TABLE reservation'); - $this->addSql('DROP TABLE reserve'); - $this->addSql('DROP TABLE status_order'); - $this->addSql('DROP TABLE status_table'); - $this->addSql('DROP TABLE "table"'); - $this->addSql('DROP TABLE table_customer'); - $this->addSql('DROP TABLE table_user'); - $this->addSql('DROP TABLE "user"'); - $this->addSql('DROP TABLE user_reservation'); - $this->addSql('DROP TABLE messenger_messages'); - } -} diff --git a/src/Entity/Clients.php b/src/Entity/Clients.php new file mode 100644 index 0000000..179d8a5 --- /dev/null +++ b/src/Entity/Clients.php @@ -0,0 +1,117 @@ + + */ + #[ORM\ManyToMany(targetEntity: Tables::class, inversedBy: 'Tabl')] + private Collection $Tabl; + + public function __construct() + { + $this->Tabl = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + public function getPrenom(): ?string + { + return $this->Prenom; + } + + public function setPrenom(string $Prenom): static + { + $this->Prenom = $Prenom; + + return $this; + } + + public function getNom(): ?string + { + return $this->Nom; + } + + public function setNom(string $Nom): static + { + $this->Nom = $Nom; + + return $this; + } + + public function getEmail(): ?string + { + return $this->Email; + } + + public function setEmail(string $Email): static + { + $this->Email = $Email; + + return $this; + } + + public function getTelephone(): ?string + { + return $this->Telephone; + } + + public function setTelephone(string $Telephone): static + { + $this->Telephone = $Telephone; + + 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/Entity/Customer.php b/src/Entity/Customer.php deleted file mode 100644 index f962828..0000000 --- a/src/Entity/Customer.php +++ /dev/null @@ -1,86 +0,0 @@ -id; - } - - public function getFirstName(): ?string - { - return $this->FirstName; - } - - public function setFirstName(string $FirstName): static - { - $this->FirstName = $FirstName; - - return $this; - } - - public function getLastName(): ?string - { - return $this->LastName; - } - - public function setLastName(string $LastName): static - { - $this->LastName = $LastName; - - return $this; - } - - public function getEmail(): ?string - { - return $this->Email; - } - - public function setEmail(string $Email): static - { - $this->Email = $Email; - - return $this; - } - - public function getPhoneNumber(): ?string - { - return $this->PhoneNumber; - } - - public function setPhoneNumber(string $PhoneNumber): static - { - $this->PhoneNumber = $PhoneNumber; - - return $this; - } -} diff --git a/src/Entity/Discount.php b/src/Entity/Discount.php deleted file mode 100644 index 988d720..0000000 --- a/src/Entity/Discount.php +++ /dev/null @@ -1,100 +0,0 @@ -id; - } - - public function getDescription(): ?string - { - return $this->Description; - } - - public function setDescription(string $Description): static - { - $this->Description = $Description; - - return $this; - } - - public function getPercentage(): ?string - { - return $this->Percentage; - } - - public function setPercentage(string $Percentage): static - { - $this->Percentage = $Percentage; - - return $this; - } - - public function getFixedAmount(): ?float - { - return $this->FixedAmount; - } - - public function setFixedAmount(float $FixedAmount): static - { - $this->FixedAmount = $FixedAmount; - - return $this; - } - - public function getStartDate(): ?\DateTimeInterface - { - return $this->StartDate; - } - - public function setStartDate(\DateTimeInterface $StartDate): static - { - $this->StartDate = $StartDate; - - return $this; - } - - public function getEndDate(): ?\DateTimeInterface - { - return $this->EndDate; - } - - public function setEndDate(\DateTimeInterface $EndDate): static - { - $this->EndDate = $EndDate; - - return $this; - } -} diff --git a/src/Entity/Dishes.php b/src/Entity/Dishes.php deleted file mode 100644 index 713066a..0000000 --- a/src/Entity/Dishes.php +++ /dev/null @@ -1,103 +0,0 @@ -id; - } - - public function getName(): ?string - { - return $this->Name; - } - - public function setName(string $Name): static - { - $this->Name = $Name; - - return $this; - } - - public function getDescription(): ?string - { - return $this->Description; - } - - public function setDescription(string $Description): static - { - $this->Description = $Description; - - return $this; - } - - public function getPrice(): ?float - { - return $this->Price; - } - - public function setPrice(float $Price): static - { - $this->Price = $Price; - - return $this; - } - - public function getStatus(): ?string - { - return $this->Status; - } - - public function setStatus(string $Status): static - { - $this->Status = $Status; - - return $this; - } - - public function getNumberOrder(): ?string - { - return $this->NumberOrder; - } - - public function setNumberOrder(string $NumberOrder): static - { - $this->NumberOrder = $NumberOrder; - - return $this; - } -} diff --git a/src/Entity/Eat.php b/src/Entity/Eat.php deleted file mode 100644 index a7dc469..0000000 --- a/src/Entity/Eat.php +++ /dev/null @@ -1,20 +0,0 @@ -id; - } -} diff --git a/src/Entity/Have.php b/src/Entity/Have.php deleted file mode 100644 index 6818dcb..0000000 --- a/src/Entity/Have.php +++ /dev/null @@ -1,20 +0,0 @@ -id; - } -} diff --git a/src/Entity/Order.php b/src/Entity/Order.php deleted file mode 100644 index 06d91ba..0000000 --- a/src/Entity/Order.php +++ /dev/null @@ -1,81 +0,0 @@ -id; - } - - public function getDateHeure(): ?\DateTimeInterface - { - return $this->DateHeure; - } - - public function setDateHeure(\DateTimeInterface $DateHeure): static - { - $this->DateHeure = $DateHeure; - - return $this; - } - - public function getStatusOrder(): ?string - { - return $this->StatusOrder; - } - - public function setStatusOrder(string $StatusOrder): static - { - $this->StatusOrder = $StatusOrder; - - return $this; - } - - public function getPriceOrder(): ?string - { - return $this->PriceOrder; - } - - public function setPriceOrder(string $PriceOrder): static - { - $this->PriceOrder = $PriceOrder; - - return $this; - } -} diff --git a/src/Entity/OrderDetail.php b/src/Entity/OrderDetail.php deleted file mode 100644 index e8ca11b..0000000 --- a/src/Entity/OrderDetail.php +++ /dev/null @@ -1,55 +0,0 @@ -id; - } - - public function getQuantity(): ?int - { - return $this->Quantity; - } - - public function setQuantity(int $Quantity): static - { - $this->Quantity = $Quantity; - - return $this; - } - - public function getUnitaryPrice(): ?string - { - return $this->UnitaryPrice; - } - - public function setUnitaryPrice(string $UnitaryPrice): static - { - $this->UnitaryPrice = $UnitaryPrice; - - return $this; - } -} diff --git a/src/Entity/Ordering.php b/src/Entity/Ordering.php deleted file mode 100644 index 4933911..0000000 --- a/src/Entity/Ordering.php +++ /dev/null @@ -1,20 +0,0 @@ -id; - } -} diff --git a/src/Entity/Reservation.php b/src/Entity/Reservation.php deleted file mode 100644 index a39eedc..0000000 --- a/src/Entity/Reservation.php +++ /dev/null @@ -1,56 +0,0 @@ -id; - } - - public function getDateHeure(): ?\DateTimeInterface - { - return $this->DateHeure; - } - - public function setDateHeure(\DateTimeInterface $DateHeure): static - { - $this->DateHeure = $DateHeure; - - return $this; - } - - public function getNumberCustomer(): ?int - { - return $this->NumberCustomer; - } - - public function setNumberCustomer(int $NumberCustomer): static - { - $this->NumberCustomer = $NumberCustomer; - - return $this; - } -} diff --git a/src/Entity/Reservations.php b/src/Entity/Reservations.php new file mode 100644 index 0000000..0291004 --- /dev/null +++ b/src/Entity/Reservations.php @@ -0,0 +1,106 @@ + + */ + #[ORM\ManyToMany(targetEntity: Utilisateurs::class, mappedBy: 'Reservation')] + private Collection $utilisateurs; + + public function __construct() + { + $this->utilisateurs = 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 getNbDePrsn(): ?int + { + return $this->Nb_de_prsn; + } + + public function setNbDePrsn(int $Nb_de_prsn): static + { + $this->Nb_de_prsn = $Nb_de_prsn; + + return $this; + } + + public function getTabl(): ?Tables + { + return $this->Tabl; + } + + public function setTabl(?Tables $Tabl): static + { + $this->Tabl = $Tabl; + + 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->addReservation($this); + } + + return $this; + } + + public function removeUtilisateur(Utilisateurs $utilisateur): static + { + if ($this->utilisateurs->removeElement($utilisateur)) { + $utilisateur->removeReservation($this); + } + + return $this; + } +} diff --git a/src/Entity/Reserve.php b/src/Entity/Reserve.php deleted file mode 100644 index dda7fcd..0000000 --- a/src/Entity/Reserve.php +++ /dev/null @@ -1,20 +0,0 @@ -id; - } -} diff --git a/src/Entity/StatusOrder.php b/src/Entity/StatusOrder.php deleted file mode 100644 index 2d6c3c8..0000000 --- a/src/Entity/StatusOrder.php +++ /dev/null @@ -1,40 +0,0 @@ -id; - } - - public function getStatusOrder(): ?string - { - return $this->StatusOrder; - } - - public function setStatusOrder(string $StatusOrder): static - { - $this->StatusOrder = $StatusOrder; - - return $this; - } -} diff --git a/src/Entity/StatusTable.php b/src/Entity/StatusTable.php deleted file mode 100644 index 2631ff3..0000000 --- a/src/Entity/StatusTable.php +++ /dev/null @@ -1,40 +0,0 @@ -id; - } - - public function getStatus(): ?string - { - return $this->Status; - } - - public function setStatus(string $Status): static - { - $this->Status = $Status; - - return $this; - } -} diff --git a/src/Entity/Table.php b/src/Entity/Table.php deleted file mode 100644 index 2292b20..0000000 --- a/src/Entity/Table.php +++ /dev/null @@ -1,40 +0,0 @@ -id; - } -} diff --git a/src/Entity/Tables.php b/src/Entity/Tables.php new file mode 100644 index 0000000..548d631 --- /dev/null +++ b/src/Entity/Tables.php @@ -0,0 +1,97 @@ + + */ + #[ORM\ManyToMany(targetEntity: Clients::class, mappedBy: 'Tabl')] + private Collection $Tabl; + + /** + * @var Collection + */ + #[ORM\OneToMany(targetEntity: Reservations::class, mappedBy: 'Tabl')] + private Collection $reservations; + + public function __construct() + { + $this->Tabl = new ArrayCollection(); + $this->reservations = new ArrayCollection(); + } + + public function getId(): ?int + { + return $this->id; + } + + /** + * @return Collection + */ + public function getTabl(): Collection + { + return $this->Tabl; + } + + public function addTabl(Clients $tabl): static + { + if (!$this->Tabl->contains($tabl)) { + $this->Tabl->add($tabl); + $tabl->addTabl($this); + } + + return $this; + } + + public function removeTabl(Clients $tabl): static + { + if ($this->Tabl->removeElement($tabl)) { + $tabl->removeTabl($this); + } + + return $this; + } + + /** + * @return Collection + */ + public function getReservations(): Collection + { + return $this->reservations; + } + + public function addReservation(Reservations $reservation): static + { + if (!$this->reservations->contains($reservation)) { + $this->reservations->add($reservation); + $reservation->setTabl($this); + } + + return $this; + } + + public function removeReservation(Reservations $reservation): static + { + if ($this->reservations->removeElement($reservation)) { + // set the owning side to null (unless already changed) + if ($reservation->getTabl() === $this) { + $reservation->setTabl(null); + } + } + + return $this; + } +} diff --git a/src/Entity/User.php b/src/Entity/User.php deleted file mode 100644 index 97b5fdb..0000000 --- a/src/Entity/User.php +++ /dev/null @@ -1,103 +0,0 @@ -id; - } - - public function getFirstName(): ?string - { - return $this->FirstName; - } - - public function setFirstName(string $FirstName): static - { - $this->FirstName = $FirstName; - - return $this; - } - - public function getLastName(): ?string - { - return $this->LastName; - } - - public function setLastName(string $LastName): static - { - $this->LastName = $LastName; - - return $this; - } - - public function getMail(): ?string - { - return $this->Mail; - } - - public function setMail(string $Mail): static - { - $this->Mail = $Mail; - - return $this; - } - - public function getPassword(): ?string - { - return $this->Password; - } - - public function setPassword(string $Password): static - { - $this->Password = $Password; - - return $this; - } - - public function getRole(): ?string - { - return $this->Role; - } - - public function setRole(string $Role): static - { - $this->Role = $Role; - - return $this; - } -} diff --git a/src/Entity/Utilisateurs.php b/src/Entity/Utilisateurs.php new file mode 100644 index 0000000..3fd6279 --- /dev/null +++ b/src/Entity/Utilisateurs.php @@ -0,0 +1,132 @@ + + */ + #[ORM\ManyToMany(targetEntity: Reservations::class, inversedBy: 'utilisateurs')] + private Collection $Reservation; + + public function __construct() + { + $this->Reservation = 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 getPrenom(): ?string + { + return $this->Prenom; + } + + public function setPrenom(string $Prenom): static + { + $this->Prenom = $Prenom; + + return $this; + } + + public function getMail(): ?string + { + return $this->Mail; + } + + public function setMail(string $Mail): static + { + $this->Mail = $Mail; + + return $this; + } + + public function getMotDePasse(): ?string + { + return $this->MotDePasse; + } + + public function setMotDePasse(string $MotDePasse): static + { + $this->MotDePasse = $MotDePasse; + + return $this; + } + + public function getRole(): ?string + { + return $this->Role; + } + + public function setRole(string $Role): static + { + $this->Role = $Role; + + return $this; + } + + /** + * @return Collection + */ + public function getReservation(): Collection + { + return $this->Reservation; + } + + public function addReservation(Reservations $reservation): static + { + if (!$this->Reservation->contains($reservation)) { + $this->Reservation->add($reservation); + } + + return $this; + } + + public function removeReservation(Reservations $reservation): static + { + $this->Reservation->removeElement($reservation); + + return $this; + } +} From d6b82235b541bca19ed125a4a08beb62f8f1607a Mon Sep 17 00:00:00 2001 From: Joshua Date: Thu, 17 Oct 2024 16:34:44 +0200 Subject: [PATCH 18/20] 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() +// ; +// } +} From cfbaf2ab047e291bb0baafadbec40e4a84b89093 Mon Sep 17 00:00:00 2001 From: Joshua Date: Thu, 17 Oct 2024 16:51:55 +0200 Subject: [PATCH 19/20] Merge sur devellop de release/Login et release/Migration --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 954200c..5adc745 100644 --- a/.gitignore +++ b/.gitignore @@ -188,4 +188,5 @@ fabric.properties # End of https://www.toptal.com/developers/gitignore/api/symfony,phpstorm,git /vendor/ -.idea/ \ No newline at end of file +.idea/ +.env.local \ No newline at end of file From 82640eef86f0967da4a3817c25e03dfeb2c00054 Mon Sep 17 00:00:00 2001 From: bethoulevj Date: Thu, 17 Oct 2024 16:54:13 +0200 Subject: [PATCH 20/20] Supprimer .env.local --- .env.local | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 .env.local diff --git a/.env.local b/.env.local deleted file mode 100644 index 7c751c8..0000000 --- a/.env.local +++ /dev/null @@ -1,41 +0,0 @@ -# In all environments, the following files are loaded if they exist, -# the latter taking precedence over the former: -# -# * .env contains default values for the environment variables needed by the app -# * .env.local uncommitted file with local overrides -# * .env.$APP_ENV committed environment-specific defaults -# * .env.$APP_ENV.local uncommitted environment-specific overrides -# -# Real environment variables win over .env files. -# -# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES. -# https://symfony.com/doc/current/configuration/secrets.html -# -# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2). -# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration - -###> symfony/framework-bundle ### -APP_ENV=dev -APP_SECRET=36d6a0fd0e8606a88d3cc51aed9e3dc5 -###< symfony/framework-bundle ### - -###> doctrine/doctrine-bundle ### -# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url -# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml -# -# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db" -# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4" -# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4" -DATABASE_URL="postgresql://postgres:root@localhost:5432/festinhegre?serverVersion=16&charset=utf8" -###< doctrine/doctrine-bundle ### - -###> symfony/messenger ### -# Choose one of the transports below -# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages -# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages -MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 -###< symfony/messenger ### - -###> symfony/mailer ### -# MAILER_DSN=null://null -###< symfony/mailer ###