Image.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. * @Gedmo\Uploadable(fileInfoProperty="fileInfo", pathMethod="getPath")
  9. */
  10. class Image
  11. {
  12. /**
  13. * @ORM\Column(name="id", type="integer")
  14. * @ORM\Id
  15. * @ORM\GeneratedValue(strategy="IDENTITY")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\Column(name="title", type="string")
  20. */
  21. private $title;
  22. /**
  23. * @ORM\Column(name="path", type="string", nullable=true)
  24. * @Gedmo\UploadableFilePath
  25. */
  26. private $filePath;
  27. private $fileInfo;
  28. public function getId()
  29. {
  30. return $this->id;
  31. }
  32. public function setTitle($title)
  33. {
  34. $this->title = $title;
  35. }
  36. public function getTitle()
  37. {
  38. return $this->title;
  39. }
  40. public function setFilePath($filePath)
  41. {
  42. $this->filePath = $filePath;
  43. }
  44. public function getFilePath()
  45. {
  46. return $this->filePath;
  47. }
  48. public function setFileInfo(array $fileInfo)
  49. {
  50. $this->fileInfo = $fileInfo;
  51. }
  52. public function getFileInfo()
  53. {
  54. return $this->fileInfo;
  55. }
  56. public function getPath()
  57. {
  58. return __DIR__.'/../../../../temp/uploadable';
  59. }
  60. }