SampleInterface.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. use Magento\Downloadable\Api\Data\File\ContentInterface;
  8. /**
  9. * @codeCoverageIgnore
  10. * @api
  11. * @since 100.0.2
  12. */
  13. interface SampleInterface extends \Magento\Framework\Api\ExtensibleDataInterface
  14. {
  15. /**
  16. * Product sample id
  17. *
  18. * @return int|null Sample(or link) id
  19. */
  20. public function getId();
  21. /**
  22. * Set product sample id
  23. *
  24. * @param int $id
  25. * @return $this
  26. */
  27. public function setId($id);
  28. /**
  29. * Sample title
  30. *
  31. * @return string
  32. */
  33. public function getTitle();
  34. /**
  35. * Set sample title
  36. *
  37. * @param string $title
  38. * @return $this
  39. */
  40. public function setTitle($title);
  41. /**
  42. * Sort order index for sample
  43. *
  44. * @return int
  45. */
  46. public function getSortOrder();
  47. /**
  48. * Set sort order index for sample
  49. *
  50. * @param int $sortOrder
  51. * @return $this
  52. */
  53. public function setSortOrder($sortOrder);
  54. /**
  55. * @return string
  56. */
  57. public function getSampleType();
  58. /**
  59. * @param string $sampleType
  60. * @return $this
  61. */
  62. public function setSampleType($sampleType);
  63. /**
  64. * Return file path or null when type is 'url'
  65. *
  66. * @return string|null relative file path
  67. */
  68. public function getSampleFile();
  69. /**
  70. * Set file path or null when type is 'url'
  71. *
  72. * @param string $sampleFile
  73. * @return $this
  74. */
  75. public function setSampleFile($sampleFile);
  76. /**
  77. * Retrieve sample file content
  78. *
  79. * @return \Magento\Downloadable\Api\Data\File\ContentInterface|null
  80. */
  81. public function getSampleFileContent();
  82. /**
  83. * Set sample file content
  84. *
  85. * @param \Magento\Downloadable\Api\Data\File\ContentInterface $sampleFileContent
  86. * @return $this
  87. */
  88. public function setSampleFileContent(ContentInterface $sampleFileContent = null);
  89. /**
  90. * Return URL or NULL when type is 'file'
  91. *
  92. * @return string|null file URL
  93. */
  94. public function getSampleUrl();
  95. /**
  96. * Set sample URL
  97. *
  98. * @param string $sampleUrl
  99. * @return $this
  100. */
  101. public function setSampleUrl($sampleUrl);
  102. /**
  103. * Retrieve existing extension attributes object or create a new one.
  104. *
  105. * @return \Magento\Downloadable\Api\Data\SampleExtensionInterface|null
  106. */
  107. public function getExtensionAttributes();
  108. /**
  109. * Set an extension attributes object.
  110. *
  111. * @param \Magento\Downloadable\Api\Data\SampleExtensionInterface $extensionAttributes
  112. * @return $this
  113. */
  114. public function setExtensionAttributes(
  115. \Magento\Downloadable\Api\Data\SampleExtensionInterface $extensionAttributes
  116. );
  117. }