<?php
namespace App\Entity\PointsCatalog;
use App\Annotation\SiteAware;
use App\Entity\AbstractBase;
use App\Entity\Interfaces\SiteInterface;
use App\Entity\MiniAbstractBase;
use App\Entity\Traits\PositionTrait;
use App\Entity\Traits\PublishedTrait;
use App\Entity\Traits\SiteTrait;
use App\Repository\PointsCatalog\CatalogFaqRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Table(name="vulco_points_catalog_faq", indexes={@ORM\Index(name="catalog_faq_site_idx", columns={"site"})})
* @ORM\Entity(repositoryClass=CatalogFaqRepository::class)
* @Gedmo\SoftDeleteable(fieldName="removedAt", timeAware=false)
* @SiteAware(siteFieldName="site")
*/
class CatalogFaq extends AbstractBase implements SiteInterface
{
use PositionTrait;
use PublishedTrait;
use SiteTrait;
/**
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank()
*/
private string $question;
/**
* @ORM\Column(type="text", length=10000, nullable=true)
* @Assert\NotBlank()
*/
private ?string $answer = null;
/**
* @ORM\Column(type="integer")
* @Assert\NotBlank()
*/
private int $position;
public function getQuestion(): string
{
return $this->question;
}
public function setQuestion(string $question): self
{
$this->question = $question;
return $this;
}
public function getAnswer(): ?string
{
return $this->answer;
}
public function setAnswer(?string $answer): self
{
$this->answer = $answer;
return $this;
}
public function __toString(): string
{
return $this->question ? $this->getQuestion() : MiniAbstractBase::DEFAULT_EMPTY_STRING;
}
}