VoidCache.php 887 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace Doctrine\Common\Cache;
  3. /**
  4. * Void cache driver. The cache could be of use in tests where you don`t need to cache anything.
  5. *
  6. * @link www.doctrine-project.org
  7. */
  8. class VoidCache extends CacheProvider
  9. {
  10. /**
  11. * {@inheritDoc}
  12. */
  13. protected function doFetch($id)
  14. {
  15. return false;
  16. }
  17. /**
  18. * {@inheritDoc}
  19. */
  20. protected function doContains($id)
  21. {
  22. return false;
  23. }
  24. /**
  25. * {@inheritDoc}
  26. */
  27. protected function doSave($id, $data, $lifeTime = 0)
  28. {
  29. return true;
  30. }
  31. /**
  32. * {@inheritDoc}
  33. */
  34. protected function doDelete($id)
  35. {
  36. return true;
  37. }
  38. /**
  39. * {@inheritDoc}
  40. */
  41. protected function doFlush()
  42. {
  43. return true;
  44. }
  45. /**
  46. * {@inheritDoc}
  47. */
  48. protected function doGetStats()
  49. {
  50. return;
  51. }
  52. }