src/Entity/PrescriberActivityStatus.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PrescriberActivityStatusRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassPrescriberActivityStatusRepository::class)]
  8. class PrescriberActivityStatus
  9. {
  10.     use IdentifiableTrait;
  11.     #[ORM\Column(length255)]
  12.     private ?string $name null;
  13.     #[ORM\Column(length255)]
  14.     private ?string $slug null;
  15.     #[ORM\OneToMany(mappedBy'activityStatus'targetEntityPrescriber::class)]
  16.     private Collection $prescribers;
  17.     public function __construct()
  18.     {
  19.         $this->prescribers = new ArrayCollection();
  20.     }
  21.     public function __toString(): string
  22.     {
  23.         return $this->name;
  24.     }
  25.     public function getId(): ?int
  26.     {
  27.         return $this->id;
  28.     }
  29.     public function getName(): ?string
  30.     {
  31.         return $this->name;
  32.     }
  33.     public function setName(string $name): static
  34.     {
  35.         $this->name $name;
  36.         return $this;
  37.     }
  38.     public function getSlug(): ?string
  39.     {
  40.         return $this->slug;
  41.     }
  42.     public function setSlug(string $slug): static
  43.     {
  44.         $this->slug $slug;
  45.         return $this;
  46.     }
  47.     /**
  48.      * @return Collection<int, Prescriber>
  49.      */
  50.     public function getPrescribers(): Collection
  51.     {
  52.         return $this->prescribers;
  53.     }
  54.     public function addPrescriber(Prescriber $prescriber): static
  55.     {
  56.         if (!$this->prescribers->contains($prescriber)) {
  57.             $this->prescribers->add($prescriber);
  58.             $prescriber->setActivityStatus($this);
  59.         }
  60.         return $this;
  61.     }
  62.     public function removePrescriber(Prescriber $prescriber): static
  63.     {
  64.         if ($this->prescribers->removeElement($prescriber)) {
  65.             // set the owning side to null (unless already changed)
  66.             if ($prescriber->getActivityStatus() === $this) {
  67.                 $prescriber->setActivityStatus(null);
  68.             }
  69.         }
  70.         return $this;
  71.     }
  72. }