src/Entity/EtatPaiement.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EtatPaiementRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=EtatPaiementRepository::class)
  9.  */
  10. class EtatPaiement
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $nom;
  22.     /**
  23.      * @ORM\OneToMany(targetEntity=Order::class, mappedBy="etatpaiement")
  24.      */
  25.     private $orders;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=true)
  28.      */
  29.     private $name_en;
  30.     /**
  31.      * @ORM\OneToMany(targetEntity=Forecast::class, mappedBy="etatpaiement")
  32.      */
  33.     private $forecasts;
  34.     public function __construct()
  35.     {
  36.         $this->orders = new ArrayCollection();
  37.         $this->forecasts = new ArrayCollection();
  38.     }
  39.     public function __toString(){
  40.         return $this->getNom();
  41.     }
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getNom(): ?string
  47.     {
  48.         return $this->nom;
  49.     }
  50.     public function setNom(string $nom): self
  51.     {
  52.         $this->nom $nom;
  53.         return $this;
  54.     }
  55.     /**
  56.      * @return Collection<int, Order>
  57.      */
  58.     public function getOrders(): Collection
  59.     {
  60.         return $this->orders;
  61.     }
  62.     public function addOrder(Order $order): self
  63.     {
  64.         if (!$this->orders->contains($order)) {
  65.             $this->orders[] = $order;
  66.             $order->setEtatpaiement($this);
  67.         }
  68.         return $this;
  69.     }
  70.     public function removeOrder(Order $order): self
  71.     {
  72.         if ($this->orders->removeElement($order)) {
  73.             // set the owning side to null (unless already changed)
  74.             if ($order->getEtatpaiement() === $this) {
  75.                 $order->setEtatpaiement(null);
  76.             }
  77.         }
  78.         return $this;
  79.     }
  80.     public function getNameEn(): ?string
  81.     {
  82.         return $this->name_en;
  83.     }
  84.     public function setNameEn(?string $name_en): self
  85.     {
  86.         $this->name_en $name_en;
  87.         return $this;
  88.     }
  89.     /**
  90.      * @return Collection<int, Forecast>
  91.      */
  92.     public function getForecasts(): Collection
  93.     {
  94.         return $this->forecasts;
  95.     }
  96.     public function addForecast(Forecast $forecast): self
  97.     {
  98.         if (!$this->forecasts->contains($forecast)) {
  99.             $this->forecasts[] = $forecast;
  100.             $forecast->setEtatpaiement($this);
  101.         }
  102.         return $this;
  103.     }
  104.     public function removeForecast(Forecast $forecast): self
  105.     {
  106.         if ($this->forecasts->removeElement($forecast)) {
  107.             // set the owning side to null (unless already changed)
  108.             if ($forecast->getEtatpaiement() === $this) {
  109.                 $forecast->setEtatpaiement(null);
  110.             }
  111.         }
  112.         return $this;
  113.     }
  114. }