src/Entity/Content/StaticPageTranslation.php line 17

  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: artemglebov
  5.  * Date: 28/02/2018
  6.  * Time: 20:48
  7.  */
  8. namespace App\Entity\Content;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Knp\DoctrineBehaviors\Contract\Entity\TranslationInterface;
  11. use Knp\DoctrineBehaviors\Model\Translatable\TranslationTrait;
  12. #[ORM\Table(name'static_page_translation')]
  13. #[ORM\Entity]
  14. class StaticPageTranslation implements TranslationInterface
  15. {
  16.     use TranslationTrait {
  17.         isEmpty as ttEmpty;
  18.     }
  19.     #[ORM\Id]
  20.     #[ORM\GeneratedValue(strategy'AUTO')]
  21.     #[ORM\Column(type'integer')]
  22.     private $id;
  23.     #[ORM\Column(type'string')]
  24.     private ?string $caption null;
  25.     #[ORM\Column(type'text'nullabletrue)]
  26.     private ?string $content null;
  27.     public function isEmpty(): bool
  28.     {
  29.         $parentResult $this->ttEmpty();
  30.         if ($parentResult) {
  31.             return true;
  32.         }
  33.         if (empty($this->caption)) {
  34.             return true;
  35.         }
  36.         return false;
  37.     }
  38.     /**
  39.      * @return mixed
  40.      */
  41.     public function getId()
  42.     {
  43.         return $this->id;
  44.     }
  45.     /**
  46.      * @param mixed $id
  47.      */
  48.     public function setId($id): void
  49.     {
  50.         $this->id $id;
  51.     }
  52.     /**
  53.      * @return string|null
  54.      */
  55.     public function getCaption(): ?string
  56.     {
  57.         return $this->caption;
  58.     }
  59.     /**
  60.      * @param string|null $caption
  61.      */
  62.     public function setCaption(?string $caption): void
  63.     {
  64.         $this->caption $caption;
  65.     }
  66.     /**
  67.      * @return string|null
  68.      */
  69.     public function getContent(): ?string
  70.     {
  71.         return $this->content;
  72.     }
  73.     /**
  74.      * @param string|null $content
  75.      */
  76.     public function setContent(?string $content): void
  77.     {
  78.         $this->content $content;
  79.     }
  80. }