diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml
index 0b73c9c..15f93b9 100644
--- a/.idea/dataSources.xml
+++ b/.idea/dataSources.xml
@@ -5,7 +5,7 @@
postgresql
true
org.postgresql.Driver
- jdbc:postgresql://localhost:5433/ferme
+ jdbc:postgresql://localhost:5432/ferme
$ProjectFileDir$
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
deleted file mode 100644
index d829d01..0000000
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/php.xml b/.idea/php.xml
index a873179..a081fbb 100644
--- a/.idea/php.xml
+++ b/.idea/php.xml
@@ -15,6 +15,7 @@
+
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index d5f5372..dd56244 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -6,8 +6,13 @@
+
+
+
+
+
@@ -20,7 +25,6 @@
-
+
+
+
@@ -51,7 +58,7 @@
-
+
@@ -214,36 +221,39 @@
- {
- "keyToString": {
- "RunOnceActivity.MCP Project settings loaded": "true",
- "RunOnceActivity.ShowReadmeOnStart": "true",
- "RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
- "RunOnceActivity.git.unshallow": "true",
- "RunOnceActivity.typescript.service.memoryLimit.init": "true",
- "git-widget-placeholder": "develop",
- "last_opened_file_path": "/home/sroy/Documents/test/Ferme",
- "node.js.detected.package.eslint": "true",
- "node.js.detected.package.tslint": "true",
- "node.js.selected.package.eslint": "(autodetect)",
- "node.js.selected.package.tslint": "(autodetect)",
- "nodejs_package_manager_path": "npm",
- "settings.editor.selected.configurable": "configurable.group.appearance",
- "ts.external.directory.path": "/opt/phpstorm/plugins/javascript-plugin/jsLanguageServicesImpl/external",
- "vue.rearranger.settings.migration": "true"
+
+}]]>
@@ -287,6 +297,7 @@
+
diff --git a/src/Entity/Address.php b/src/Entity/Address.php
index 81903d4..c06a159 100644
--- a/src/Entity/Address.php
+++ b/src/Entity/Address.php
@@ -64,9 +64,16 @@ class Address
#[ORM\ManyToMany(targetEntity: Supplier::class, mappedBy: 'addresses')]
private Collection $suppliers;
+ /**
+ * @var Collection
+ */
+ #[ORM\OneToMany(targetEntity: Customer::class, mappedBy: 'id_adress')]
+ private Collection $customers;
+
public function __construct()
{
$this->suppliers = new ArrayCollection();
+ $this->customers = new ArrayCollection();
}
public function getId(): ?int
@@ -165,4 +172,34 @@ class Address
{
return $this->suppliers;
}
+
+ /**
+ * @return Collection
+ */
+ public function getCustomers(): Collection
+ {
+ return $this->customers;
+ }
+
+ public function addCustomer(Customer $customer): static
+ {
+ if (!$this->customers->contains($customer)) {
+ $this->customers->add($customer);
+ $customer->setIdAdress($this);
+ }
+
+ return $this;
+ }
+
+ public function removeCustomer(Customer $customer): static
+ {
+ if ($this->customers->removeElement($customer)) {
+ // set the owning side to null (unless already changed)
+ if ($customer->getIdAdress() === $this) {
+ $customer->setIdAdress(null);
+ }
+ }
+
+ return $this;
+ }
}
diff --git a/src/Entity/Carrier.php b/src/Entity/Carrier.php
index d9a16a2..5f9ace4 100644
--- a/src/Entity/Carrier.php
+++ b/src/Entity/Carrier.php
@@ -7,6 +7,8 @@ namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GetCollection;
+use Doctrine\Common\Collections\ArrayCollection;
+use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Attribute\Groups;
@@ -40,6 +42,24 @@ class Carrier
#[Groups(['carrier:read', 'driver:read', 'vehicle:read', 'reception:read'])]
private ?string $code = null;
+ /**
+ * @var Collection
+ */
+ #[ORM\OneToMany(targetEntity: Shipment::class, mappedBy: 'id_carrier')]
+ private Collection $id_carrier_1;
+
+ /**
+ * @var Collection
+ */
+ #[ORM\OneToMany(targetEntity: Shipment::class, mappedBy: 'licence_plate_1')]
+ private Collection $shipments;
+
+ public function __construct()
+ {
+ $this->id_carrier_1 = new ArrayCollection();
+ $this->shipments = new ArrayCollection();
+ }
+
public function getId(): ?int
{
return $this->id;
@@ -68,4 +88,64 @@ class Carrier
return $this;
}
+
+ /**
+ * @return Collection
+ */
+ public function getIdCarrier1(): Collection
+ {
+ return $this->id_carrier_1;
+ }
+
+ public function addIdCarrier1(Shipment $idCarrier1): static
+ {
+ if (!$this->id_carrier_1->contains($idCarrier1)) {
+ $this->id_carrier_1->add($idCarrier1);
+ $idCarrier1->setIdCarrier($this);
+ }
+
+ return $this;
+ }
+
+ public function removeIdCarrier1(Shipment $idCarrier1): static
+ {
+ if ($this->id_carrier_1->removeElement($idCarrier1)) {
+ // set the owning side to null (unless already changed)
+ if ($idCarrier1->getIdCarrier() === $this) {
+ $idCarrier1->setIdCarrier(null);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * @return Collection
+ */
+ public function getShipments(): Collection
+ {
+ return $this->shipments;
+ }
+
+ public function addShipment(Shipment $shipment): static
+ {
+ if (!$this->shipments->contains($shipment)) {
+ $this->shipments->add($shipment);
+ $shipment->setLicencePlate1($this);
+ }
+
+ return $this;
+ }
+
+ public function removeShipment(Shipment $shipment): static
+ {
+ if ($this->shipments->removeElement($shipment)) {
+ // set the owning side to null (unless already changed)
+ if ($shipment->getLicencePlate1() === $this) {
+ $shipment->setLicencePlate1(null);
+ }
+ }
+
+ return $this;
+ }
}
diff --git a/src/Entity/Vehicle.php b/src/Entity/Vehicle.php
index 6a849ed..ea6ec10 100644
--- a/src/Entity/Vehicle.php
+++ b/src/Entity/Vehicle.php
@@ -8,6 +8,8 @@ use ApiPlatform\Metadata\ApiProperty;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GetCollection;
+use Doctrine\Common\Collections\ArrayCollection;
+use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Attribute\Groups;
@@ -49,6 +51,17 @@ class Vehicle
#[ApiProperty(readableLink: true)]
private ?Truck $truck = null;
+ /**
+ * @var Collection
+ */
+ #[ORM\OneToMany(targetEntity: Shipment::class, mappedBy: 'id_carrier_1')]
+ private Collection $shipments;
+
+ public function __construct()
+ {
+ $this->shipments = new ArrayCollection();
+ }
+
public function getId(): ?int
{
return $this->id;
@@ -89,4 +102,34 @@ class Vehicle
return $this;
}
+
+ /**
+ * @return Collection
+ */
+ public function getShipments(): Collection
+ {
+ return $this->shipments;
+ }
+
+ public function addShipment(Shipment $shipment): static
+ {
+ if (!$this->shipments->contains($shipment)) {
+ $this->shipments->add($shipment);
+ $shipment->setIdCarrier1($this);
+ }
+
+ return $this;
+ }
+
+ public function removeShipment(Shipment $shipment): static
+ {
+ if ($this->shipments->removeElement($shipment)) {
+ // set the owning side to null (unless already changed)
+ if ($shipment->getIdCarrier1() === $this) {
+ $shipment->setIdCarrier1(null);
+ }
+ }
+
+ return $this;
+ }
}