CatalogRuleRepositoryInterface.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\CatalogRule\Api;
  7. /**
  8. * Interface CatalogRuleRepositoryInterface
  9. * @api
  10. * @since 100.1.0
  11. */
  12. interface CatalogRuleRepositoryInterface
  13. {
  14. /**
  15. * @param \Magento\CatalogRule\Api\Data\RuleInterface $rule
  16. * @return \Magento\CatalogRule\Api\Data\RuleInterface
  17. * @throws \Magento\Framework\Exception\CouldNotSaveException
  18. * @since 100.1.0
  19. */
  20. public function save(\Magento\CatalogRule\Api\Data\RuleInterface $rule);
  21. /**
  22. * @param int $ruleId
  23. * @return \Magento\CatalogRule\Api\Data\RuleInterface
  24. * @throws \Magento\Framework\Exception\NoSuchEntityException
  25. * @since 100.1.0
  26. */
  27. public function get($ruleId);
  28. /**
  29. * @param \Magento\CatalogRule\Api\Data\RuleInterface $rule
  30. * @return bool
  31. * @throws \Magento\Framework\Exception\CouldNotDeleteException
  32. * @since 100.1.0
  33. */
  34. public function delete(\Magento\CatalogRule\Api\Data\RuleInterface $rule);
  35. /**
  36. * @param int $ruleId
  37. * @return bool
  38. * @throws \Magento\Framework\Exception\CouldNotDeleteException
  39. * @since 100.1.0
  40. */
  41. public function deleteById($ruleId);
  42. }