StorageInterface.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * @copyright Vertex. All rights reserved. https://www.vertexinc.com/
  4. * @author Mediotype https://www.mediotype.com/
  5. */
  6. namespace Vertex\Tax\Model\TaxRegistry;
  7. /**
  8. * Tax registry storage for persisting Vertex tax information.
  9. *
  10. * The goal of this interface is provide a means for persistent storage when supported, so that requests for tax
  11. * information over a period of time can be served from local storage instead of APIs.
  12. */
  13. interface StorageInterface
  14. {
  15. /**
  16. * Retrieve an item from storage.
  17. *
  18. * @param string $key
  19. * @param string $default
  20. * @return mixed
  21. */
  22. public function get($key, $default = null);
  23. /**
  24. * Write an item to storage.
  25. *
  26. * @param string $key
  27. * @param string $value
  28. * @param int $lifetime
  29. * @return boolean
  30. */
  31. public function set($key, $value, $lifetime = 0);
  32. /**
  33. * Remove an item from storage.
  34. *
  35. * @param string $key
  36. * @return boolean
  37. */
  38. public function unsetData($key);
  39. }