Comment.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. namespace Translatable\Fixture;
  3. use Gedmo\Mapping\Annotation as Gedmo;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity
  7. */
  8. class Comment
  9. {
  10. /** @ORM\Id @ORM\GeneratedValue @ORM\Column(type="integer") */
  11. private $id;
  12. /**
  13. * @Gedmo\Translatable
  14. * @ORM\Column(name="subject", type="string", length=128)
  15. */
  16. private $subject;
  17. /**
  18. * @Gedmo\Translatable
  19. * @ORM\Column(name="message", type="text")
  20. */
  21. private $message;
  22. /**
  23. * @ORM\ManyToOne(targetEntity="Article", inversedBy="comments")
  24. */
  25. private $article;
  26. /**
  27. * Used locale to override Translation listener`s locale
  28. * @Gedmo\Language
  29. */
  30. private $locale;
  31. public function setArticle($article)
  32. {
  33. $this->article = $article;
  34. }
  35. public function getId()
  36. {
  37. return $this->id;
  38. }
  39. public function setSubject($subject)
  40. {
  41. $this->subject = $subject;
  42. }
  43. public function getSubject()
  44. {
  45. return $this->subject;
  46. }
  47. public function setMessage($message)
  48. {
  49. $this->message = $message;
  50. }
  51. public function getMessage()
  52. {
  53. return $this->message;
  54. }
  55. public function setTranslatableLocale($locale)
  56. {
  57. $this->locale = $locale;
  58. }
  59. }