From ba4ad2efb0de8cdeb488e4f03fa26bed08827b06 Mon Sep 17 00:00:00 2001 From: firdaous elhalafi Date: Wed, 20 Dec 2023 20:43:29 +0100 Subject: [PATCH 1/2] ajout de la table sale avec les getters et les setters --- .gitignore | 2 + api/.gitignore | 4 ++ api/README.md | 8 ++++ api/src/Entity/Vente.php | 95 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 109 insertions(+) create mode 100644 api/src/Entity/Vente.php diff --git a/.gitignore b/.gitignore index 2a5536b..b2f649c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /.env /helm/api-platform/charts/* !/helm/api-platform/charts/.gitignore + +.idea/* diff --git a/api/.gitignore b/api/.gitignore index d270e41..ae93018 100644 --- a/api/.gitignore +++ b/api/.gitignore @@ -19,3 +19,7 @@ .phpunit.result.cache /phpunit.xml ###< symfony/phpunit-bridge ### + +### Migration ### +/migrations/* +``` diff --git a/api/README.md b/api/README.md index d0edd4c..8941c79 100644 --- a/api/README.md +++ b/api/README.md @@ -3,3 +3,11 @@ The API will be here. Refer to the [Getting Started Guide](https://api-platform.com/docs/distribution) for more information. + +## Migrations and database + +```bash +docker compose exec php bin/console doctrine:migrations:diff +docker compose exec php bin/console doctrine:migrations:migrate +``` + diff --git a/api/src/Entity/Vente.php b/api/src/Entity/Vente.php new file mode 100644 index 0000000..9ceb2c1 --- /dev/null +++ b/api/src/Entity/Vente.php @@ -0,0 +1,95 @@ +date = $date; + $this->amount = $amount; + $this->surface = $surface; + $this->region = $region; + } + + // getters + public function getId(): ?int + { + return $this->id; + } + + public function getDate(): ?\DateTimeInterface + { + return $this->date; + } + + public function getAmount(): ?float + { + return $this->amount; + } + + public function getSurface(): ?float + { + return $this->surface; + } + + public function getRegion(): ?string + { + return $this->region; + } + + // setters + public function setDate(\DateTimeImmutable $date): void + { + $this->date = $date; + } + + public function setAmount(float $amount): void + { + $this->amount = $amount; + } + + public function setSurface(float $surface): void + { + $this->surface = $surface; + } + + public function setRegion(string $region): void + { + $this->region = $region; + } +} -- GitLab From 1f992be909374d9943f6740c20ec5ea30319c35e Mon Sep 17 00:00:00 2001 From: firdaous elhalafi Date: Thu, 21 Dec 2023 16:42:15 +0100 Subject: [PATCH 2/2] Rennomage de la classe Vente --- api/src/Entity/{Vente.php => Sale.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename api/src/Entity/{Vente.php => Sale.php} (100%) diff --git a/api/src/Entity/Vente.php b/api/src/Entity/Sale.php similarity index 100% rename from api/src/Entity/Vente.php rename to api/src/Entity/Sale.php -- GitLab