CacheInterface.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\Framework\App;
  8. /**
  9. * System cache model interface
  10. *
  11. * @api
  12. * @since 100.0.2
  13. */
  14. interface CacheInterface
  15. {
  16. /**
  17. * Get cache frontend API object
  18. *
  19. * @return \Magento\Framework\Cache\FrontendInterface
  20. */
  21. public function getFrontend();
  22. /**
  23. * Load data from cache by id
  24. *
  25. * @param string $identifier
  26. * @return string
  27. */
  28. public function load($identifier);
  29. /**
  30. * Save data
  31. *
  32. * @param string $data
  33. * @param string $identifier
  34. * @param array $tags
  35. * @param int $lifeTime
  36. * @return bool
  37. */
  38. public function save($data, $identifier, $tags = [], $lifeTime = null);
  39. /**
  40. * Remove cached data by identifier
  41. *
  42. * @param string $identifier
  43. * @return bool
  44. */
  45. public function remove($identifier);
  46. /**
  47. * Clean cached data by specific tag
  48. *
  49. * @param array $tags
  50. * @return bool
  51. */
  52. public function clean($tags = []);
  53. }