<?php
namespace App\Entity;
use App\Repository\BestelstatusRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: BestelstatusRepository::class)]
class Bestelstatus
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 50, nullable: true)]
private ?string $status = null;
#[ORM\OneToMany(mappedBy: 'status', targetEntity: Bestelling::class)]
private Collection $bestellingen;
public function __construct()
{
$this->bestellingen = new ArrayCollection();
}
public function __toString()
{
return $this->status;
}
public function getId(): ?int
{
return $this->id;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(?string $status): static
{
$this->status = $status;
return $this;
}
/**
* @return Collection<int, Bestelling>
*/
public function getBestellingen(): Collection
{
return $this->bestellingen;
}
public function addBestellingen(Bestelling $bestellingen): static
{
if (!$this->bestellingen->contains($bestellingen)) {
$this->bestellingen->add($bestellingen);
$bestellingen->setStatus($this);
}
return $this;
}
public function removeBestellingen(Bestelling $bestellingen): static
{
if ($this->bestellingen->removeElement($bestellingen)) {
// set the owning side to null (unless already changed)
if ($bestellingen->getStatus() === $this) {
$bestellingen->setStatus(null);
}
}
return $this;
}
}