src/Entity/Content/NewsTranslation.php line 16
- <?php
- /**
- * Created by PhpStorm.
- * User: Михаил
- * Date: 21.12.2018
- * Time: 11:20
- */
- namespace App\Entity\Content;
- use Doctrine\ORM\Mapping as ORM;
- use Knp\DoctrineBehaviors\Contract\Entity\TranslationInterface;
- use Knp\DoctrineBehaviors\Model\Translatable\TranslationTrait;
- #[ORM\Entity]
- class NewsTranslation implements TranslationInterface
- {
- use TranslationTrait {
- isEmpty as ttEmpty;
- }
- #[ORM\Id]
- #[ORM\Column(type: 'integer')]
- #[ORM\GeneratedValue(strategy: 'AUTO')]
- private ?int $id;
- #[ORM\Column(type: 'string')]
- private ?string $caption = null;
- #[ORM\Column(type: 'string', length: 250, nullable: true)]
- private ?string $subtitle = null;
- #[ORM\Column(type: 'text', nullable: true)]
- private ?string $preview = null;
- #[ORM\Column(type: 'text', nullable: true)]
- private ?string $text = null;
- public function isEmpty(): bool
- {
- $parentResult = $this->ttEmpty();
- if ($parentResult) {
- return true;
- }
- if (empty($this->caption)) {
- return true;
- }
- if (empty($this->text)) {
- return true;
- }
- return false;
- }
- /**
- * @return int|null
- */
- public function getId(): ?int
- {
- return $this->id;
- }
- /**
- * @param int|null $id
- */
- public function setId(?int $id): void
- {
- $this->id = $id;
- }
- /**
- * @return string|null
- */
- public function getCaption(): ?string
- {
- return $this->caption;
- }
- /**
- * @param string|null $caption
- */
- public function setCaption(?string $caption): void
- {
- $this->caption = $caption;
- }
- /**
- * @return string|null
- */
- public function getSubtitle(): ?string
- {
- return $this->subtitle;
- }
- /**
- * @param string|null $subtitle
- */
- public function setSubtitle(?string $subtitle): void
- {
- $this->subtitle = $subtitle;
- }
- /**
- * @return string|null
- */
- public function getPreview(): ?string
- {
- return $this->preview;
- }
- /**
- * @param string|null $preview
- */
- public function setPreview(?string $preview): void
- {
- $this->preview = $preview;
- }
- /**
- * @return string|null
- */
- public function getText(): ?string
- {
- return $this->text;
- }
- /**
- * @param string|null $text
- */
- public function setText(?string $text): void
- {
- $this->text = $text;
- }
- }