TaxClassRepositoryInterface.php 2.5 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 class CRUD interface.
  10. * @api
  11. * @since 100.0.2
  12. */
  13. interface TaxClassRepositoryInterface
  14. {
  15. /**
  16. * Get a tax class with the given tax class id.
  17. *
  18. * @param int $taxClassId
  19. * @return \Magento\Tax\Api\Data\TaxClassInterface
  20. * @throws \Magento\Framework\Exception\NoSuchEntityException If tax class with $taxClassId does not exist
  21. */
  22. public function get($taxClassId);
  23. /**
  24. * Retrieve tax classes which match a specific criteria.
  25. *
  26. * This call returns an array of objects, but detailed information about each object’s attributes might not be
  27. * included. See https://devdocs.magento.com/codelinks/attributes.html#TaxClassRepositoryInterface to
  28. * determine which call to use to get detailed information about all attributes for an object.
  29. *
  30. * @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
  31. * @return \Magento\Tax\Api\Data\TaxClassSearchResultsInterface containing Data\TaxClassInterface
  32. * @throws \Magento\Framework\Exception\InputException
  33. */
  34. public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria);
  35. /**
  36. * Create a Tax Class
  37. *
  38. * @param \Magento\Tax\Api\Data\TaxClassInterface $taxClass
  39. * @return string id for the newly created Tax class
  40. * @throws \Magento\Framework\Exception\InputException
  41. * @throws \Magento\Framework\Exception\LocalizedException
  42. */
  43. public function save(\Magento\Tax\Api\Data\TaxClassInterface $taxClass);
  44. /**
  45. * Delete a tax class
  46. *
  47. * @param \Magento\Tax\Api\Data\TaxClassInterface $taxClass
  48. * @return bool True if the tax class was deleted, false otherwise
  49. * @throws \Magento\Framework\Exception\NoSuchEntityException If tax class with $taxClassId does not exist
  50. * @throws \Magento\Framework\Exception\CouldNotDeleteException
  51. */
  52. public function delete(\Magento\Tax\Api\Data\TaxClassInterface $taxClass);
  53. /**
  54. * Delete a tax class with the given tax class id.
  55. *
  56. * @param int $taxClassId
  57. * @return bool True if the tax class was deleted, false otherwise
  58. * @throws \Magento\Framework\Exception\NoSuchEntityException If tax class with $taxClassId does not exist
  59. * @throws \Magento\Framework\Exception\CouldNotDeleteException
  60. */
  61. public function deleteById($taxClassId);
  62. }