src/Entity/Common/CountryTranslation.php line 11

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