Article.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. namespace Uploadable\Fixture\Entity;
  3. use Gedmo\Mapping\Annotation as Gedmo;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. /**
  7. * @ORM\Entity
  8. */
  9. class Article
  10. {
  11. /**
  12. * @ORM\Column(name="id", type="integer")
  13. * @ORM\Id
  14. * @ORM\GeneratedValue(strategy="IDENTITY")
  15. */
  16. private $id;
  17. /**
  18. * @ORM\Column(name="title", type="string")
  19. */
  20. private $title;
  21. /**
  22. * @ORM\OneToMany(targetEntity="File", mappedBy="article", cascade={"persist", "remove"})
  23. */
  24. private $files;
  25. public function __construct()
  26. {
  27. $this->files = new ArrayCollection();
  28. }
  29. public function getId()
  30. {
  31. return $this->id;
  32. }
  33. public function setTitle($title)
  34. {
  35. $this->title = $title;
  36. }
  37. public function getTitle()
  38. {
  39. return $this->title;
  40. }
  41. public function setFilePath($filePath)
  42. {
  43. $this->filePath = $filePath;
  44. }
  45. public function getFilePath()
  46. {
  47. return $this->filePath;
  48. }
  49. public function getFiles()
  50. {
  51. return $this->files;
  52. }
  53. public function addFile(File $file)
  54. {
  55. $this->files[] = $file;
  56. }
  57. }