src/Entity/Nouvelleorder.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\NouvelleorderRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=NouvelleorderRepository::class)
  9.  */
  10. class Nouvelleorder
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="orders")
  20.      */
  21.     private $user;
  22.     /**
  23.      * @ORM\Column(type="datetime")
  24.      */
  25.     private $date;
  26.     /**
  27.      * @ORM\Column(type="decimal", precision=10, scale=2)
  28.      */
  29.     private $total;
  30.     /**
  31.      * @ORM\Column(type="string", length=255)
  32.      */
  33.     private $numerocommande;
  34.     /**
  35.      * @ORM\Column(type="string", length=255)
  36.      */
  37.     private $status;
  38.     /**
  39.      * @ORM\OneToMany(targetEntity=Precommission::class, mappedBy="orderid")
  40.      */
  41.     private $precommissions;
  42.     public function __construct()
  43.     {
  44.         $this->commissions = new ArrayCollection();
  45.         $this->precommissions = new ArrayCollection();
  46.     }
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getUser(): ?User
  52.     {
  53.         return $this->user;
  54.     }
  55.     public function setUser(?User $user): self
  56.     {
  57.         $this->user $user;
  58.         return $this;
  59.     }
  60.     public function getDate(): ?\DateTimeInterface
  61.     {
  62.         return $this->date;
  63.     }
  64.     public function setDate(\DateTimeInterface $date): self
  65.     {
  66.         $this->date $date;
  67.         return $this;
  68.     }
  69.     public function getTotal(): ?string
  70.     {
  71.         return $this->total;
  72.     }
  73.     public function setTotal(string $total): self
  74.     {
  75.         $this->total $total;
  76.         return $this;
  77.     }
  78.     public function getNumerocommande(): ?string
  79.     {
  80.         return $this->numerocommande;
  81.     }
  82.     public function setNumerocommande(string $numerocommande): self
  83.     {
  84.         $this->numerocommande $numerocommande;
  85.         return $this;
  86.     }
  87.     public function getStatus(): ?string
  88.     {
  89.         return $this->status;
  90.     }
  91.     public function setStatus(string $status): self
  92.     {
  93.         $this->status $status;
  94.         return $this;
  95.     }
  96.     /**
  97.      * @return Collection<int, Precommission>
  98.      */
  99.     public function getPrecommissions(): Collection
  100.     {
  101.         return $this->precommissions;
  102.     }
  103.     public function addPrecommission(Precommission $precommission): self
  104.     {
  105.         if (!$this->precommissions->contains($precommission)) {
  106.             $this->precommissions[] = $precommission;
  107.             $precommission->setOrderid($this);
  108.         }
  109.         return $this;
  110.     }
  111.     public function removePrecommission(Precommission $precommission): self
  112.     {
  113.         if ($this->precommissions->removeElement($precommission)) {
  114.             // set the owning side to null (unless already changed)
  115.             if ($precommission->getOrderid() === $this) {
  116.                 $precommission->setOrderid(null);
  117.             }
  118.         }
  119.         return $this;
  120.     }
  121. }