<?php
namespace App\Entity;
use App\Repository\HelpProgramRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=HelpProgramRepository::class)
*/
class HelpProgram
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\ManyToMany(targetEntity=Person::class, inversedBy="helpPrograms")
*/
private $persons;
/**
* @ORM\ManyToOne(targetEntity=HelpProgramParent::class, inversedBy="helpPrograms")
*/
private $parent;
public function __construct()
{
$this->persons = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
/**
* @return Collection<int, Person>
*/
public function getPersons(): Collection
{
return $this->persons;
}
public function addPerson(Person $person): self
{
if (!$this->persons->contains($person)) {
$this->persons[] = $person;
}
return $this;
}
public function removePerson(Person $person): self
{
$this->persons->removeElement($person);
return $this;
}
public function getParent(): ?HelpProgramParent
{
return $this->parent;
}
public function setParent(?HelpProgramParent $parent): self
{
$this->parent = $parent;
return $this;
}
}