UploadImageRequest.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?php
  2. /**
  3. * Class UploadImageRequest
  4. *
  5. * Aliyun VoD's Upload Image Request class, which wraps parameters to upload an image into VoD.
  6. * Users could pass parameters to AliyunVodUploader, including File Path,Title,etc. via an UploadImageRequest instance.
  7. * For more details, please check out the VoD API document: https://help.aliyun.com/document_detail/55619.html
  8. */
  9. class UploadImageRequest
  10. {
  11. public function __construct($filePath, $title=null) {
  12. $this->setFilePath($filePath, $title);
  13. $this->imageType = 'default';
  14. }
  15. public function getFilePath() {
  16. return $this->filePath;
  17. }
  18. public function setFilePath($filePath, $title=null) {
  19. $this->filePath = $filePath;
  20. $fns = AliyunVodUtils::getFileName($this->filePath);
  21. $this->fileName = $fns[0];
  22. $extName = AliyunVodUtils::getFileExtension($this->fileName);
  23. if (empty($extName)) {
  24. throw new Exception('filePath has no Extension', 'InvalidParameter');
  25. }
  26. $this->imageExt = $extName;
  27. if (isset($title)) {
  28. $this->title = $title;
  29. }
  30. else {
  31. if (!isset($this->title)) {
  32. $this->title = $fns[1];
  33. }
  34. }
  35. }
  36. public function getFileName() {
  37. return $this->fileName;
  38. }
  39. public function getImageType() {
  40. return $this->imageType;
  41. }
  42. public function setImageType($imageType) {
  43. $this->imageType = $imageType;
  44. }
  45. public function getImageExt() {
  46. return $this->imageExt;
  47. }
  48. public function getMediaExt() {
  49. return $this->imageExt;
  50. }
  51. public function getTitle() {
  52. return $this->title;
  53. }
  54. public function setTitle($title) {
  55. $this->title = $title;
  56. }
  57. public function getCateId() {
  58. return $this->cateId;
  59. }
  60. public function setCateId($cateId) {
  61. $this->cateId = $cateId;
  62. }
  63. public function getTags() {
  64. return $this->tags;
  65. }
  66. public function setTags($tags) {
  67. $this->tags = $tags;
  68. }
  69. public function getDescription() {
  70. return $this->description;
  71. }
  72. public function setDescription($description) {
  73. $this->description = $description;
  74. }
  75. public function getStorageLocation() {
  76. return $this->storageLocation;
  77. }
  78. public function setStorageLocation($storageLocation) {
  79. $this->storageLocation = $storageLocation;
  80. }
  81. public function getUserData() {
  82. return $this->userData;
  83. }
  84. public function setUserData($userData) {
  85. $this->userData = $userData;
  86. }
  87. public function getAppId() {
  88. return $this->appId;
  89. }
  90. public function setAppId($appId) {
  91. $this->appId = $appId;
  92. }
  93. public function getWorkflowId() {
  94. return $this->workflowId;
  95. }
  96. public function setWorkflowId($WorkflowId) {
  97. $this->workflowId = $WorkflowId;
  98. }
  99. private $filePath = null;
  100. private $fileName = null;
  101. private $imageType = null;
  102. private $imageExt = null;
  103. private $title = null;
  104. private $cateId = null;
  105. private $tags = null;
  106. private $description = null;
  107. private $storageLocation = null;
  108. private $userData = null;
  109. private $appId = null;
  110. private $workflowId = null;
  111. }