BlockRepositoryInterface.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Cms\Api;
  7. /**
  8. * CMS block CRUD interface.
  9. * @api
  10. * @since 100.0.2
  11. */
  12. interface BlockRepositoryInterface
  13. {
  14. /**
  15. * Save block.
  16. *
  17. * @param \Magento\Cms\Api\Data\BlockInterface $block
  18. * @return \Magento\Cms\Api\Data\BlockInterface
  19. * @throws \Magento\Framework\Exception\LocalizedException
  20. */
  21. public function save(Data\BlockInterface $block);
  22. /**
  23. * Retrieve block.
  24. *
  25. * @param int $blockId
  26. * @return \Magento\Cms\Api\Data\BlockInterface
  27. * @throws \Magento\Framework\Exception\LocalizedException
  28. */
  29. public function getById($blockId);
  30. /**
  31. * Retrieve blocks matching the specified criteria.
  32. *
  33. * @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
  34. * @return \Magento\Cms\Api\Data\BlockSearchResultsInterface
  35. * @throws \Magento\Framework\Exception\LocalizedException
  36. */
  37. public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria);
  38. /**
  39. * Delete block.
  40. *
  41. * @param \Magento\Cms\Api\Data\BlockInterface $block
  42. * @return bool true on success
  43. * @throws \Magento\Framework\Exception\LocalizedException
  44. */
  45. public function delete(Data\BlockInterface $block);
  46. /**
  47. * Delete block by ID.
  48. *
  49. * @param int $blockId
  50. * @return bool true on success
  51. * @throws \Magento\Framework\Exception\NoSuchEntityException
  52. * @throws \Magento\Framework\Exception\LocalizedException
  53. */
  54. public function deleteById($blockId);
  55. }