TaxRuleRepositoryInterface.php 2.2 KB

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