<?php
namespace App\Entity\Gos;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\Gos\FaqSectionRepository")
*/
class FaqSection
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\FaqItem", mappedBy="faqSection", cascade={"persist"})
*/
private $faqItems;
public function __construct()
{
$this->faqItems = 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|FaqItem[]
*/
public function getFaqItems(): Collection
{
return $this->faqItems;
}
public function addFaqItem(FaqItem $faqItem): self
{
if (!$this->faqItems->contains($faqItem)) {
$this->faqItems[] = $faqItem;
$faqItem->setFaqSection($this);
}
return $this;
}
public function removeFaqItem(FaqItem $faqItem): self
{
if ($this->faqItems->contains($faqItem)) {
$this->faqItems->removeElement($faqItem);
// set the owning side to null (unless already changed)
if ($faqItem->getFaqSection() === $this) {
$faqItem->setFaqSection(null);
}
}
return $this;
}
}