<?php
namespace App\Entity;
use App\Repository\EtatPaiementRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=EtatPaiementRepository::class)
*/
class EtatPaiement
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $nom;
/**
* @ORM\OneToMany(targetEntity=Order::class, mappedBy="etatpaiement")
*/
private $orders;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $name_en;
/**
* @ORM\OneToMany(targetEntity=Forecast::class, mappedBy="etatpaiement")
*/
private $forecasts;
public function __construct()
{
$this->orders = new ArrayCollection();
$this->forecasts = new ArrayCollection();
}
public function __toString(){
return $this->getNom();
}
public function getId(): ?int
{
return $this->id;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(string $nom): self
{
$this->nom = $nom;
return $this;
}
/**
* @return Collection<int, Order>
*/
public function getOrders(): Collection
{
return $this->orders;
}
public function addOrder(Order $order): self
{
if (!$this->orders->contains($order)) {
$this->orders[] = $order;
$order->setEtatpaiement($this);
}
return $this;
}
public function removeOrder(Order $order): self
{
if ($this->orders->removeElement($order)) {
// set the owning side to null (unless already changed)
if ($order->getEtatpaiement() === $this) {
$order->setEtatpaiement(null);
}
}
return $this;
}
public function getNameEn(): ?string
{
return $this->name_en;
}
public function setNameEn(?string $name_en): self
{
$this->name_en = $name_en;
return $this;
}
/**
* @return Collection<int, Forecast>
*/
public function getForecasts(): Collection
{
return $this->forecasts;
}
public function addForecast(Forecast $forecast): self
{
if (!$this->forecasts->contains($forecast)) {
$this->forecasts[] = $forecast;
$forecast->setEtatpaiement($this);
}
return $this;
}
public function removeForecast(Forecast $forecast): self
{
if ($this->forecasts->removeElement($forecast)) {
// set the owning side to null (unless already changed)
if ($forecast->getEtatpaiement() === $this) {
$forecast->setEtatpaiement(null);
}
}
return $this;
}
}