TaxRateRepositoryInterface.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\Tax\Api;
  8. /**
  9. * Tax rate CRUD interface.
  10. * @api
  11. * @since 100.0.2
  12. */
  13. interface TaxRateRepositoryInterface
  14. {
  15. /**
  16. * Create or update tax rate
  17. *
  18. * @param \Magento\Tax\Api\Data\TaxRateInterface $taxRate
  19. * @return \Magento\Tax\Api\Data\TaxRateInterface
  20. * @throws \Magento\Framework\Exception\InputException If input is invalid or required input is missing.
  21. * @throws \Exception If something went wrong while creating the TaxRate.
  22. */
  23. public function save(\Magento\Tax\Api\Data\TaxRateInterface $taxRate);
  24. /**
  25. * Get tax rate
  26. *
  27. * @param int $rateId
  28. * @return \Magento\Tax\Api\Data\TaxRateInterface
  29. * @throws \Magento\Framework\Exception\NoSuchEntityException
  30. */
  31. public function get($rateId);
  32. /**
  33. * Delete tax rate
  34. *
  35. * @param int $rateId
  36. * @return bool
  37. * @throws \Magento\Framework\Exception\NoSuchEntityException If no TaxRate with the given ID can be found.
  38. * @throws \Exception If something went wrong while performing the delete.
  39. */
  40. public function deleteById($rateId);
  41. /**
  42. * Search TaxRates
  43. *
  44. * This call returns an array of objects, but detailed information about each object’s attributes might not be
  45. * included. See https://devdocs.magento.com/codelinks/attributes.html#TaxRateRepositoryInterface to
  46. * determine which call to use to get detailed information about all attributes for an object.
  47. *
  48. * @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
  49. * @return \Magento\Tax\Api\Data\TaxRateSearchResultsInterface containing Data\TaxRateInterface objects
  50. * @throws \Magento\Framework\Exception\InputException If there is a problem with the input
  51. */
  52. public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria);
  53. /**
  54. * Delete tax rate
  55. *
  56. * @param \Magento\Tax\Api\Data\TaxRateInterface $taxRate
  57. * @return bool
  58. * @throws \Magento\Framework\Exception\NoSuchEntityException If no TaxRate with the given ID can be found.
  59. * @throws \Exception If something went wrong while performing the delete.
  60. */
  61. public function delete(\Magento\Tax\Api\Data\TaxRateInterface $taxRate);
  62. }