src/Entity/Content/MaterialTranslation.php line 17
- <?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\Table(name: 'material_translation')]
- #[ORM\Entity]
- class MaterialTranslation 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;
- public function isEmpty(): bool
- {
- $parentResult = $this->ttEmpty();
- if ($parentResult) {
- return true;
- }
- if (empty($this->caption)) {
- 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;
- }
- }