Article.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. namespace Translatable\Fixture\Issue75;
  3. /**
  4. * @Entity
  5. */
  6. class Article
  7. {
  8. /**
  9. * @Id
  10. * @GeneratedValue
  11. * @Column(type="integer")
  12. */
  13. private $id;
  14. /**
  15. * @gedmo:Translatable
  16. * @Column(name="title", type="string", length=128)
  17. */
  18. private $title;
  19. /**
  20. * @ManyToMany(targetEntity="Image", inversedBy="articles")
  21. * @JoinTable(name="article_images",
  22. * joinColumns={@JoinColumn(name="image_id", referencedColumnName="id")},
  23. * inverseJoinColumns={@JoinColumn(name="article_id", referencedColumnName="id")}
  24. * )
  25. */
  26. private $images;
  27. /**
  28. * @ManyToMany(targetEntity="File")
  29. */
  30. private $files;
  31. public function getId()
  32. {
  33. return $this->id;
  34. }
  35. public function addImage(Image $image)
  36. {
  37. $this->images[] = $image;
  38. }
  39. public function setImages(array $images)
  40. {
  41. $this->images = $images;
  42. }
  43. public function getImages()
  44. {
  45. return $this->images;
  46. }
  47. public function addFile(File $file)
  48. {
  49. $this->files[] = $file;
  50. }
  51. public function getFiles()
  52. {
  53. return $this->files;
  54. }
  55. public function setTitle($title)
  56. {
  57. $this->title = $title;
  58. }
  59. public function getTitle()
  60. {
  61. return $this->title;
  62. }
  63. }