<?phpnamespace App\Entity;use App\Repository\NouvelleorderRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=NouvelleorderRepository::class) */class Nouvelleorder{ /** * @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=Precommission::class, mappedBy="orderid") */ private $precommissions; public function __construct() { $this->commissions = new ArrayCollection(); $this->precommissions = 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, Precommission> */ public function getPrecommissions(): Collection { return $this->precommissions; } public function addPrecommission(Precommission $precommission): self { if (!$this->precommissions->contains($precommission)) { $this->precommissions[] = $precommission; $precommission->setOrderid($this); } return $this; } public function removePrecommission(Precommission $precommission): self { if ($this->precommissions->removeElement($precommission)) { // set the owning side to null (unless already changed) if ($precommission->getOrderid() === $this) { $precommission->setOrderid(null); } } return $this; }}