src/Entity/HelpProgram.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\HelpProgramRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=HelpProgramRepository::class)
  9.  */
  10. class HelpProgram
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\ManyToMany(targetEntity=Person::class, inversedBy="helpPrograms")
  24.      */
  25.     private $persons;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity=HelpProgramParent::class, inversedBy="helpPrograms")
  28.      */
  29.     private $parent;
  30.     public function __construct()
  31.     {
  32.         $this->persons = new ArrayCollection();
  33.     }
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getName(): ?string
  39.     {
  40.         return $this->name;
  41.     }
  42.     public function setName(string $name): self
  43.     {
  44.         $this->name $name;
  45.         return $this;
  46.     }
  47.     /**
  48.      * @return Collection<int, Person>
  49.      */
  50.     public function getPersons(): Collection
  51.     {
  52.         return $this->persons;
  53.     }
  54.     public function addPerson(Person $person): self
  55.     {
  56.         if (!$this->persons->contains($person)) {
  57.             $this->persons[] = $person;
  58.         }
  59.         return $this;
  60.     }
  61.     public function removePerson(Person $person): self
  62.     {
  63.         $this->persons->removeElement($person);
  64.         return $this;
  65.     }
  66.     public function getParent(): ?HelpProgramParent
  67.     {
  68.         return $this->parent;
  69.     }
  70.     public function setParent(?HelpProgramParent $parent): self
  71.     {
  72.         $this->parent $parent;
  73.         return $this;
  74.     }
  75. }