Image.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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(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. /**
  28. * @ORM\Column(name="size", type="decimal", nullable=true)
  29. * @Gedmo\UploadableFileSize
  30. */
  31. private $size;
  32. /**
  33. * @ORM\Column(name="mime_type", type="string", nullable=true)
  34. * @Gedmo\UploadableFileMimeType
  35. */
  36. private $mime;
  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. public function setFilePath($filePath)
  50. {
  51. $this->filePath = $filePath;
  52. }
  53. public function getFilePath()
  54. {
  55. return $this->filePath;
  56. }
  57. public function getPath()
  58. {
  59. return __DIR__.'/../../../../temp/uploadable';
  60. }
  61. public function setMime($mime)
  62. {
  63. $this->mime = $mime;
  64. }
  65. public function getMime()
  66. {
  67. return $this->mime;
  68. }
  69. public function setSize($size)
  70. {
  71. $this->size = $size;
  72. }
  73. public function getSize()
  74. {
  75. return $this->size;
  76. }
  77. }