src/Entity/Content/FAQ/FaqTranslation.php line 10

  1. <?php
  2. namespace App\Entity\Content\FAQ;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Knp\DoctrineBehaviors\Contract\Entity\TranslationInterface;
  5. use Knp\DoctrineBehaviors\Model\Translatable\TranslationTrait;
  6. #[ORM\Entity]
  7. class FaqTranslation implements TranslationInterface
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue(strategy'AUTO')]
  11.     #[ORM\Column(type'integer')]
  12.     private ?int $id null;
  13.     use TranslationTrait {
  14.         isEmpty as ttEmpty;
  15.     }
  16.     #[ORM\Column(type'string'nullabletrue)]
  17.     private ?string $caption null;
  18.     #[ORM\Column(type'text'nullabletrue)]
  19.     private ?string $text null;
  20.     public function isEmpty(): bool
  21.     {
  22.         $parentResult $this->ttEmpty();
  23.         if ($parentResult) {
  24.             return true;
  25.         }
  26.         if (empty($this->caption) && empty($this->text)) return true;
  27.         return false;
  28.     }
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function setId(?int $id): void
  34.     {
  35.         $this->id $id;
  36.     }
  37.     public function getCaption(): ?string
  38.     {
  39.         return $this->caption;
  40.     }
  41.     public function setCaption(?string $caption): void
  42.     {
  43.         $this->caption $caption;
  44.     }
  45.     public function getText(): ?string
  46.     {
  47.         return $this->text;
  48.     }
  49.     public function setText(?string $text): void
  50.     {
  51.         $this->text $text;
  52.     }
  53. }