<?phpnamespace App\Entity;use App\Repository\SectionPersonRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: SectionPersonRepository::class)]class SectionPerson{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private $id; #[ORM\Column(type: 'text', nullable: true)] private $comment; #[ORM\ManyToOne(targetEntity: Person::class, inversedBy: 'sectionPersons')] #[ORM\JoinColumn(nullable: false)] private $person; #[ORM\ManyToOne(targetEntity: Section::class, inversedBy: 'sectionPersons')] #[ORM\JoinColumn(nullable: false)] private $section; #[ORM\OneToMany(mappedBy: 'sectionPerson', targetEntity: SectionPersonMeta::class, cascade: ['persist', 'remove'])] private $sectionPersonMetas; public function __construct() { $this->sectionPersonMetas = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getComment(): ?string { return $this->comment; } public function setComment(?string $comment): self { $this->comment = $comment; return $this; } public function getPerson(): ?Person { return $this->person; } public function setPerson(?Person $person): self { $this->person = $person; return $this; } public function getSection(): ?Section { return $this->section; } public function setSection(?Section $section): self { $this->section = $section; return $this; } /** * @return Collection<int, SectionPersonMeta> */ public function getSectionPersonMetas(): Collection { return $this->sectionPersonMetas; } public function addSectionPersonMeta(SectionPersonMeta $sectionPersonMeta): self { if (!$this->sectionPersonMetas->contains($sectionPersonMeta)) { $this->sectionPersonMetas[] = $sectionPersonMeta; $sectionPersonMeta->setSectionPerson($this); } return $this; } public function removeSectionPersonMeta(SectionPersonMeta $sectionPersonMeta): self { if ($this->sectionPersonMetas->removeElement($sectionPersonMeta)) { // set the owning side to null (unless already changed) if ($sectionPersonMeta->getSectionPerson() === $this) { $sectionPersonMeta->setSectionPerson(null); } } return $this; }}