src/Entity/PointsCatalog/CatalogFaq.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\Entity\PointsCatalog;
  3. use App\Annotation\SiteAware;
  4. use App\Entity\AbstractBase;
  5. use App\Entity\Interfaces\SiteInterface;
  6. use App\Entity\MiniAbstractBase;
  7. use App\Entity\Traits\PositionTrait;
  8. use App\Entity\Traits\PublishedTrait;
  9. use App\Entity\Traits\SiteTrait;
  10. use App\Repository\PointsCatalog\CatalogFaqRepository;
  11. use Doctrine\ORM\Mapping as ORM;
  12. use Gedmo\Mapping\Annotation as Gedmo;
  13. use Symfony\Component\Validator\Constraints as Assert;
  14. /**
  15.  * @ORM\Table(name="vulco_points_catalog_faq", indexes={@ORM\Index(name="catalog_faq_site_idx", columns={"site"})})
  16.  * @ORM\Entity(repositoryClass=CatalogFaqRepository::class)
  17.  * @Gedmo\SoftDeleteable(fieldName="removedAt", timeAware=false)
  18.  * @SiteAware(siteFieldName="site")
  19.  */
  20. class CatalogFaq extends AbstractBase implements SiteInterface
  21. {
  22.     use PositionTrait;
  23.     use PublishedTrait;
  24.     use SiteTrait;
  25.     /**
  26.      * @ORM\Column(type="string", length=255)
  27.      * @Assert\NotBlank()
  28.      */
  29.     private string $question;
  30.     /**
  31.      * @ORM\Column(type="text", length=10000, nullable=true)
  32.      * @Assert\NotBlank()
  33.      */
  34.     private ?string $answer null;
  35.     /**
  36.      * @ORM\Column(type="integer")
  37.      * @Assert\NotBlank()
  38.      */
  39.     private int $position;
  40.     public function getQuestion(): string
  41.     {
  42.         return $this->question;
  43.     }
  44.     public function setQuestion(string $question): self
  45.     {
  46.         $this->question $question;
  47.         return $this;
  48.     }
  49.     public function getAnswer(): ?string
  50.     {
  51.         return $this->answer;
  52.     }
  53.     public function setAnswer(?string $answer): self
  54.     {
  55.         $this->answer $answer;
  56.         return $this;
  57.     }
  58.     public function __toString(): string
  59.     {
  60.         return $this->question $this->getQuestion() : MiniAbstractBase::DEFAULT_EMPTY_STRING;
  61.     }
  62. }