src/Entity/ProjectStatus.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProjectStatusRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @deprecated this Entity use over DoctrineSubscriber really Entity Classify
  9.  * @ORM\Entity(repositoryClass=ProjectStatusRepository::class)
  10.  */
  11. class ProjectStatus
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=64)
  21.      */
  22.     private $name;
  23.     /**
  24.      * @ORM\Column(type="string", length=64, nullable=true)
  25.      */
  26.     private $color;
  27.     /**
  28.      * @ORM\OneToMany(targetEntity=WorkerInProject::class, mappedBy="status")
  29.      */
  30.     private $workerInProjects;
  31.     public function __construct()
  32.     {
  33.         $this->workerInProjects = new ArrayCollection();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getName(): ?string
  40.     {
  41.         return $this->name;
  42.     }
  43.     public function setName(string $name): self
  44.     {
  45.         $this->name $name;
  46.         return $this;
  47.     }
  48.     public function getColor(): ?string
  49.     {
  50.         return $this->color;
  51.     }
  52.     public function setColor(?string $color): self
  53.     {
  54.         $this->color $color;
  55.         return $this;
  56.     }
  57.     /**
  58.      * @return Collection<int, WorkerInProject>
  59.      */
  60.     public function getWorkerInProjects(): Collection
  61.     {
  62.         return $this->workerInProjects;
  63.     }
  64.     public function addWorkerInProject(WorkerInProject $workerInProject): self
  65.     {
  66.         if (!$this->workerInProjects->contains($workerInProject)) {
  67.             $this->workerInProjects[] = $workerInProject;
  68.             $workerInProject->setStatus($this);
  69.         }
  70.         return $this;
  71.     }
  72.     public function removeWorkerInProject(WorkerInProject $workerInProject): self
  73.     {
  74.         if ($this->workerInProjects->removeElement($workerInProject)) {
  75.             // set the owning side to null (unless already changed)
  76.             if ($workerInProject->getStatus() === $this) {
  77.                 $workerInProject->setStatus(null);
  78.             }
  79.         }
  80.         return $this;
  81.     }
  82. }