<?phpnamespace App\Entity;use App\Repository\OrdersRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=OrdersRepository::class) */class Orders{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\ManyToOne(targetEntity=User::class, inversedBy="orders") */ private $user; /** * @ORM\Column(type="datetime") */ private $date; /** * @ORM\Column(type="decimal", precision=10, scale=2) */ private $total; /** * @ORM\Column(type="string", length=255) */ private $numerocommande; /** * @ORM\Column(type="string", length=255) */ private $status; /** * @ORM\OneToMany(targetEntity=Commission::class, mappedBy="orderid") */ private $commissions; public function __construct() { $this->commissions = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getUser(): ?User { return $this->user; } public function setUser(?User $user): self { $this->user = $user; return $this; } public function getDate(): ?\DateTimeInterface { return $this->date; } public function setDate(\DateTimeInterface $date): self { $this->date = $date; return $this; } public function getTotal(): ?string { return $this->total; } public function setTotal(string $total): self { $this->total = $total; return $this; } public function getNumerocommande(): ?string { return $this->numerocommande; } public function setNumerocommande(string $numerocommande): self { $this->numerocommande = $numerocommande; return $this; } public function getStatus(): ?string { return $this->status; } public function setStatus(string $status): self { $this->status = $status; return $this; } /** * @return Collection<int, Commission> */ public function getCommissions(): Collection { return $this->commissions; } public function addCommission(Commission $commission): self { if (!$this->commissions->contains($commission)) { $this->commissions[] = $commission; $commission->setOrderid($this); } return $this; } public function removeCommission(Commission $commission): self { if ($this->commissions->removeElement($commission)) { // set the owning side to null (unless already changed) if ($commission->getOrderid() === $this) { $commission->setOrderid(null); } } return $this; }}