<?phpnamespace App\Entity\Webfactory\Widget\Createur;use App\Entity\Adherent\Magasin;use App\Entity\Webfactory\Widget\FaqContenu;use App\Entity\Webfactory\Widget\WidgetAbstract;use App\Repository\Webfactory\Widget\Createur\FaqRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Table('widget_faq_createur')]#[ORM\Entity(repositoryClass: FaqRepository::class)]class Faq extends WidgetAbstract{ #[ORM\Column(length: 255)] private ?string $titre = null; #[ORM\Column] private ?\DateTimeImmutable $created_at = null; #[ORM\Column] private ?\DateTimeImmutable $updated_at = null; #[ORM\OneToMany(mappedBy: 'faq_createur', targetEntity: FaqContenu::class, cascade: ['persist', 'remove'])] private Collection $faqContenus; public function __construct() { $this->created_at = new \DateTimeImmutable('now'); $this->updated_at = new \DateTimeImmutable('now'); $this->faqContenus = new ArrayCollection(); } public function getAdherent(): ?Magasin { return $this->adherent; } public function setAdherent(?Magasin $adherent): static { $this->adherent = $adherent; return $this; } public function getCreatedAt(): ?\DateTimeImmutable { return $this->created_at; } public function setCreatedAt(\DateTimeImmutable $created_at): static { $this->created_at = $created_at; return $this; } public function getUpdatedAt(): ?\DateTimeImmutable { return $this->updated_at; } public function setUpdatedAt(\DateTimeImmutable $updated_at): static { $this->updated_at = $updated_at; return $this; } public function getTitre(): ?string { return $this->titre; } public function setTitre(string $titre): static { $this->titre = $titre; return $this; } /** * @return Collection<int, FaqContenu> */ public function getFaqContenus(): Collection { return $this->faqContenus; } public function addFaqContenu(FaqContenu $faqContenu): static { if (!$this->faqContenus->contains($faqContenu)) { $this->faqContenus->add($faqContenu); $faqContenu->setFaqClassique($this); } return $this; } public function removeFaqContenu(FaqContenu $faqContenu): static { if ($this->faqContenus->removeElement($faqContenu)) { // set the owning side to null (unless already changed) if ($faqContenu->getFaqClassique() === $this) { $faqContenu->setFaqClassique(null); } } return $this; }}