<?php
namespace App\Entity;
use App\Repository\OrderstatusRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: OrderstatusRepository::class)]
class Orderstatus
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 50)]
private ?string $status = null;
#[ORM\OneToMany(mappedBy: 'orderstatus', targetEntity: Order::class)]
private Collection $orders;
#[ORM\Column(nullable: true)]
private ?int $volgorde = null;
public function __toString()
{
return $this->status;
}
public function __construct()
{
$this->orders = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(string $status): self
{
$this->status = $status;
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->add($order);
$order->setOrderstatus($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->getOrderstatus() === $this) {
$order->setOrderstatus(null);
}
}
return $this;
}
public function getVolgorde(): ?int
{
return $this->volgorde;
}
public function setVolgorde(?int $volgorde): self
{
$this->volgorde = $volgorde;
return $this;
}
}