<?php
namespace App\Entity;
use App\Repository\PrescriberActivityStatusRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PrescriberActivityStatusRepository::class)]
class PrescriberActivityStatus
{
use IdentifiableTrait;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column(length: 255)]
private ?string $slug = null;
#[ORM\OneToMany(mappedBy: 'activityStatus', targetEntity: Prescriber::class)]
private Collection $prescribers;
public function __construct()
{
$this->prescribers = new ArrayCollection();
}
public function __toString(): string
{
return $this->name;
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): static
{
$this->slug = $slug;
return $this;
}
/**
* @return Collection<int, Prescriber>
*/
public function getPrescribers(): Collection
{
return $this->prescribers;
}
public function addPrescriber(Prescriber $prescriber): static
{
if (!$this->prescribers->contains($prescriber)) {
$this->prescribers->add($prescriber);
$prescriber->setActivityStatus($this);
}
return $this;
}
public function removePrescriber(Prescriber $prescriber): static
{
if ($this->prescribers->removeElement($prescriber)) {
// set the owning side to null (unless already changed)
if ($prescriber->getActivityStatus() === $this) {
$prescriber->setActivityStatus(null);
}
}
return $this;
}
}