src/Entity/Fraisdeliv.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FraisdelivRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassFraisdelivRepository::class)]
  8. class Fraisdeliv
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $region null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $prix null;
  18.     #[ORM\OneToMany(mappedBy'region'targetEntityClient::class, orphanRemovaltruecascade: ["remove"])]
  19.     private Collection $clients;
  20.     public function __construct()
  21.     {
  22.         $this->clients = new ArrayCollection();
  23.     }
  24.     public function __toString(): string
  25.     {
  26.         // Retournez ici la représentation sous forme de chaîne de votre entité
  27.         // Par exemple, vous pouvez retourner une propriété spécifique de votre entité
  28.         // Exemple : retourner le nom de l'entité
  29.         return $this->region;
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getRegion(): ?string
  36.     {
  37.         return $this->region;
  38.     }
  39.     public function setRegion(string $region): self
  40.     {
  41.         $this->region $region;
  42.         return $this;
  43.     }
  44.     public function getPrix(): ?string
  45.     {
  46.         return $this->prix;
  47.     }
  48.     public function setPrix(string $prix): self
  49.     {
  50.         $this->prix $prix;
  51.         return $this;
  52.     }
  53.     /**
  54.      * @return Collection<int, Client>
  55.      */
  56.     public function getClients(): Collection
  57.     {
  58.         return $this->clients;
  59.     }
  60.     public function addClient(Client $client): self
  61.     {
  62.         if (!$this->clients->contains($client)) {
  63.             $this->clients->add($client);
  64.             $client->setRegion($this);
  65.         }
  66.         return $this;
  67.     }
  68.     public function removeClient(Client $client): self
  69.     {
  70.         if ($this->clients->removeElement($client)) {
  71.             // set the owning side to null (unless already changed)
  72.             if ($client->getRegion() === $this) {
  73.                 $client->setRegion(null);
  74.             }
  75.         }
  76.         return $this;
  77.     }
  78. }