src/Entity/Gallery/AlbumTranslation.php line 10

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