src/Entity/Orderstatus.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OrderstatusRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassOrderstatusRepository::class)]
  8. class Orderstatus
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length50)]
  15.     private ?string $status null;
  16.     #[ORM\OneToMany(mappedBy'orderstatus'targetEntityOrder::class)]
  17.     
  18.     private Collection $orders;
  19.     #[ORM\Column(nullabletrue)]
  20.     private ?int $volgorde null;
  21.     public function __toString()
  22.     {
  23.         return $this->status;
  24.     }
  25.     public function __construct()
  26.     {
  27.         $this->orders = new ArrayCollection();
  28.     }
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getStatus(): ?string
  34.     {
  35.         return $this->status;
  36.     }
  37.     public function setStatus(string $status): self
  38.     {
  39.         $this->status $status;
  40.         return $this;
  41.     }
  42.     /**
  43.      * @return Collection<int, Order>
  44.      */
  45.     public function getOrders(): Collection
  46.     {
  47.         return $this->orders;
  48.     }
  49.     public function addOrder(Order $order): self
  50.     {
  51.         if (!$this->orders->contains($order)) {
  52.             $this->orders->add($order);
  53.             $order->setOrderstatus($this);
  54.         }
  55.         return $this;
  56.     }
  57.     public function removeOrder(Order $order): self
  58.     {
  59.         if ($this->orders->removeElement($order)) {
  60.             // set the owning side to null (unless already changed)
  61.             if ($order->getOrderstatus() === $this) {
  62.                 $order->setOrderstatus(null);
  63.             }
  64.         }
  65.         return $this;
  66.     }
  67.     public function getVolgorde(): ?int
  68.     {
  69.         return $this->volgorde;
  70.     }
  71.     public function setVolgorde(?int $volgorde): self
  72.     {
  73.         $this->volgorde $volgorde;
  74.         return $this;
  75.     }
  76. }