FileWithSha1Name.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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", fileInfoProperty="fileInfo", filenameGenerator="SHA1")
  9. */
  10. class FileWithSha1Name
  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="path", type="string", nullable=true)
  20. * @Gedmo\UploadableFilePath
  21. */
  22. private $filePath;
  23. private $fileInfo;
  24. public function getId()
  25. {
  26. return $this->id;
  27. }
  28. public function setFilePath($filePath)
  29. {
  30. $this->filePath = $filePath;
  31. }
  32. public function getFilePath()
  33. {
  34. return $this->filePath;
  35. }
  36. public function setFileInfo(array $fileInfo)
  37. {
  38. $this->fileInfo = $fileInfo;
  39. }
  40. public function getFileInfo()
  41. {
  42. return $this->fileInfo;
  43. }
  44. public function getPath()
  45. {
  46. return __DIR__.'/../../../../temp/uploadable';
  47. }
  48. }