CacheInterface.php 1003 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Validator\Mapping\Cache;
  11. use Symfony\Component\Validator\Mapping\ClassMetadata;
  12. /**
  13. * Persists ClassMetadata instances in a cache.
  14. *
  15. * @author Bernhard Schussek <bschussek@gmail.com>
  16. */
  17. interface CacheInterface
  18. {
  19. /**
  20. * Returns whether metadata for the given class exists in the cache.
  21. *
  22. * @param string $class
  23. */
  24. public function has($class);
  25. /**
  26. * Returns the metadata for the given class from the cache.
  27. *
  28. * @param string $class Class Name
  29. *
  30. * @return ClassMetadata|false A ClassMetadata instance or false on miss
  31. */
  32. public function read($class);
  33. /**
  34. * Stores a class metadata in the cache.
  35. */
  36. public function write(ClassMetadata $metadata);
  37. }