src/ProductBundle/Entity/Translation/ProductTranslation.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\ProductBundle\Entity\Translation;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use PN\LocaleBundle\Entity\Language;
  5. use PN\LocaleBundle\Model\EditableTranslation;
  6. use PN\LocaleBundle\Model\TranslationEntity;
  7. /**
  8. * @ORM\Entity
  9. * @ORM\Table(name="product_translations")
  10. */
  11. class ProductTranslation extends TranslationEntity implements EditableTranslation
  12. {
  13. /**
  14. * @ORM\Column(name="title", type="string", length=255, nullable=true)
  15. */
  16. protected ?string $title=null;
  17. /**
  18. * @ORM\Id
  19. * @ORM\ManyToOne(targetEntity="App\ProductBundle\Entity\Product", inversedBy="translations")
  20. */
  21. protected $translatable;
  22. /**
  23. * @var Language
  24. * @ORM\Id
  25. * @ORM\ManyToOne(targetEntity="PN\LocaleBundle\Entity\Language")
  26. */
  27. protected $language;
  28. public function getId(): ?int
  29. {
  30. return $this->translatable->getId();
  31. }
  32. public function setTitle(?string $title): static
  33. {
  34. $this->title = $title;
  35. return $this;
  36. }
  37. public function getTitle(): ?string
  38. {
  39. return $this->title;
  40. }
  41. }