<?php
namespace App\Entity;
use App\Repository\CustomerFaqRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CustomerFaqRepository::class)]
class CustomerFaq
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column]
private ?bool $active = null;
#[ORM\Column(length: 100)]
private ?string $textColor = null;
#[ORM\Column(length: 100)]
private ?string $backgroundColor = null;
#[ORM\OneToMany(mappedBy: 'customerFaq', targetEntity: CustomerFaqItem::class, cascade: ['persist', 'remove'])]
private Collection $items;
public function __construct()
{
$this->items = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function isActive(): ?bool
{
return $this->active;
}
public function setActive(bool $active): self
{
$this->active = $active;
return $this;
}
public function getTextColor(): ?string
{
return $this->textColor;
}
public function setTextColor(string $textColor): self
{
$this->textColor = $textColor;
return $this;
}
public function getBackgroundColor(): ?string
{
return $this->backgroundColor;
}
public function setBackgroundColor(string $backgroundColor): self
{
$this->backgroundColor = $backgroundColor;
return $this;
}
/**
* @return Collection<int, CustomerFaqItem>
*/
public function getItems(): Collection
{
return $this->items;
}
public function addItem(CustomerFaqItem $item): self
{
if (!$this->items->contains($item)) {
$this->items->add($item);
$item->setCustomerFaq($this);
}
return $this;
}
public function removeItem(CustomerFaqItem $item): self
{
if ($this->items->removeElement($item)) {
// set the owning side to null (unless already changed)
if ($item->getCustomerFaq() === $this) {
$item->setCustomerFaq(null);
}
}
return $this;
}
}