LinkInterface.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Downloadable\Api\Data;
  7. /**
  8. * @codeCoverageIgnore
  9. * @api
  10. * @since 100.0.2
  11. */
  12. interface LinkInterface extends \Magento\Framework\Api\ExtensibleDataInterface
  13. {
  14. /**
  15. * @return int|null Sample(or link) id
  16. */
  17. public function getId();
  18. /**
  19. * @param int $id
  20. * @return $this
  21. */
  22. public function setId($id);
  23. /**
  24. * @return string|null
  25. */
  26. public function getTitle();
  27. /**
  28. * @param string $title
  29. * @return $this
  30. */
  31. public function setTitle($title);
  32. /**
  33. * @return int
  34. */
  35. public function getSortOrder();
  36. /**
  37. * @param int $sortOrder
  38. * @return $this
  39. */
  40. public function setSortOrder($sortOrder);
  41. /**
  42. * Link shareable status
  43. * 0 -- No
  44. * 1 -- Yes
  45. * 2 -- Use config default value
  46. *
  47. * @return int
  48. */
  49. public function getIsShareable();
  50. /**
  51. * @param int $isShareable
  52. * @return $this
  53. */
  54. public function setIsShareable($isShareable);
  55. /**
  56. * Link price
  57. *
  58. * @return float
  59. */
  60. public function getPrice();
  61. /**
  62. * Set link price
  63. *
  64. * @param float $price
  65. * @return $this
  66. */
  67. public function setPrice($price);
  68. /**
  69. * Number of downloads per user
  70. * Null for unlimited downloads
  71. *
  72. * @return int|null
  73. */
  74. public function getNumberOfDownloads();
  75. /**
  76. * Set number of downloads per user
  77. * Null for unlimited downloads
  78. *
  79. * @param int $numberOfDownloads
  80. * @return $this
  81. */
  82. public function setNumberOfDownloads($numberOfDownloads);
  83. /**
  84. * @return string
  85. */
  86. public function getLinkType();
  87. /**
  88. * @param string $linkType
  89. * @return $this
  90. */
  91. public function setLinkType($linkType);
  92. /**
  93. * Return file path or null when type is 'url'
  94. *
  95. * @return string|null relative file path
  96. */
  97. public function getLinkFile();
  98. /**
  99. * Set file path or null when type is 'url'
  100. *
  101. * @param string $linkFile
  102. * @return $this
  103. */
  104. public function setLinkFile($linkFile);
  105. /**
  106. * Return file content
  107. *
  108. * @return \Magento\Downloadable\Api\Data\File\ContentInterface|null
  109. */
  110. public function getLinkFileContent();
  111. /**
  112. * Set file content
  113. *
  114. * @param \Magento\Downloadable\Api\Data\File\ContentInterface $linkFileContent
  115. * @return $this
  116. */
  117. public function setLinkFileContent(\Magento\Downloadable\Api\Data\File\ContentInterface $linkFileContent = null);
  118. /**
  119. * Return link url or null when type is 'file'
  120. *
  121. * @return string|null
  122. */
  123. public function getLinkUrl();
  124. /**
  125. * Set URL
  126. *
  127. * @param string $linkUrl
  128. * @return $this
  129. */
  130. public function setLinkUrl($linkUrl);
  131. /**
  132. * @return string
  133. */
  134. public function getSampleType();
  135. /**
  136. * @param string $sampleType
  137. * @return $this
  138. */
  139. public function setSampleType($sampleType);
  140. /**
  141. * Return file path or null when type is 'url'
  142. *
  143. * @return string|null relative file path
  144. */
  145. public function getSampleFile();
  146. /**
  147. * Set file path
  148. *
  149. * @param string $sampleFile
  150. * @return $this
  151. */
  152. public function setSampleFile($sampleFile);
  153. /**
  154. * Return sample file content when type is 'file'
  155. *
  156. * @return \Magento\Downloadable\Api\Data\File\ContentInterface|null relative file path
  157. */
  158. public function getSampleFileContent();
  159. /**
  160. * Set sample file content
  161. *
  162. * @param \Magento\Downloadable\Api\Data\File\ContentInterface $sampleFileContent
  163. * @return $this
  164. */
  165. public function setSampleFileContent(
  166. \Magento\Downloadable\Api\Data\File\ContentInterface $sampleFileContent = null
  167. );
  168. /**
  169. * Return URL or NULL when type is 'file'
  170. *
  171. * @return string|null file URL
  172. */
  173. public function getSampleUrl();
  174. /**
  175. * Set URL
  176. *
  177. * @param string $sampleUrl
  178. * @return $this
  179. */
  180. public function setSampleUrl($sampleUrl);
  181. /**
  182. * Retrieve existing extension attributes object or create a new one.
  183. *
  184. * @return \Magento\Downloadable\Api\Data\LinkExtensionInterface|null
  185. */
  186. public function getExtensionAttributes();
  187. /**
  188. * Set an extension attributes object.
  189. *
  190. * @param \Magento\Downloadable\Api\Data\LinkExtensionInterface $extensionAttributes
  191. * @return $this
  192. */
  193. public function setExtensionAttributes(\Magento\Downloadable\Api\Data\LinkExtensionInterface $extensionAttributes);
  194. }