src/Entity/RefStatus.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RefStatusRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClass: RefStatusRepository::class)]
  8. class RefStatus
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type: 'integer')]
  13.     private $id;
  14.     #[ORM\Column(type: 'string', length: 45)]
  15.     private $label;
  16.     #[ORM\Column(type: 'string', length: 45)]
  17.     private $type;
  18.     #[ORM\Column(type: 'string', length: 45, nullable: true)]
  19.     private $slug;
  20.     #[ORM\OneToMany(mappedBy: 'status', targetEntity: LitigeStatusHistory::class)]
  21.     private Collection $litigeStatusHistories;
  22.     public function __construct()
  23.     {
  24.         $this->litigeStatusHistories = new ArrayCollection();
  25.     }
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getLabel(): ?string
  31.     {
  32.         return $this->label;
  33.     }
  34.     public function setLabel(string $label): self
  35.     {
  36.         $this->label = $label;
  37.         return $this;
  38.     }
  39.     public function getType(): ?string
  40.     {
  41.         return $this->type;
  42.     }
  43.     public function setType(string $type): self
  44.     {
  45.         $this->type = $type;
  46.         return $this;
  47.     }
  48.     public function getSlug(): ?string
  49.     {
  50.         return $this->slug;
  51.     }
  52.     public function setSlug(?string $slug): self
  53.     {
  54.         $this->slug = $slug;
  55.         return $this;
  56.     }
  57.     /**
  58.      * @return Collection<int, LitigeStatusHistory>
  59.      */
  60.     public function getLitigeStatusHistories(): Collection
  61.     {
  62.         return $this->litigeStatusHistories;
  63.     }
  64.     public function addLitigeStatusHistory(LitigeStatusHistory $litigeStatusHistory): static
  65.     {
  66.         if (!$this->litigeStatusHistories->contains($litigeStatusHistory)) {
  67.             $this->litigeStatusHistories->add($litigeStatusHistory);
  68.             $litigeStatusHistory->setStatusid($this);
  69.         }
  70.         return $this;
  71.     }
  72.     public function removeLitigeStatusHistory(LitigeStatusHistory $litigeStatusHistory): static
  73.     {
  74.         if ($this->litigeStatusHistories->removeElement($litigeStatusHistory)) {
  75.             // set the owning side to null (unless already changed)
  76.             if ($litigeStatusHistory->getStatusid() === $this) {
  77.                 $litigeStatusHistory->setStatusid(null);
  78.             }
  79.         }
  80.         return $this;
  81.     }
  82. }