Article.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace Translatable\Fixture\Personal;
  3. use Gedmo\Mapping\Annotation as Gedmo;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @Gedmo\TranslationEntity(class="Translatable\Fixture\Personal\PersonalArticleTranslation")
  7. * @ORM\Entity
  8. */
  9. class Article
  10. {
  11. /**
  12. * @ORM\Id
  13. * @ORM\GeneratedValue
  14. * @ORM\Column(type="integer")
  15. */
  16. private $id;
  17. /**
  18. * @Gedmo\Translatable
  19. * @ORM\Column(length=128)
  20. */
  21. private $title;
  22. /**
  23. * @ORM\OneToMany(targetEntity="PersonalArticleTranslation", mappedBy="object")
  24. */
  25. private $translations;
  26. public function getTranslations()
  27. {
  28. return $this->translations;
  29. }
  30. public function addTranslation(PersonalArticleTranslation $t)
  31. {
  32. if (!$this->translations->contains($t)) {
  33. $this->translations[] = $t;
  34. $t->setObject($this);
  35. }
  36. }
  37. public function getId()
  38. {
  39. return $this->id;
  40. }
  41. public function setTitle($title)
  42. {
  43. $this->title = $title;
  44. }
  45. public function getTitle()
  46. {
  47. return $this->title;
  48. }
  49. }