TagAwareCacheInterface.php 1005 B

1234567891011121314151617181920212223242526272829303132333435363738
  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\Contracts\Cache;
  11. use Psr\Cache\InvalidArgumentException;
  12. /**
  13. * Allows invalidating cached items using tags.
  14. *
  15. * @author Nicolas Grekas <p@tchwork.com>
  16. */
  17. interface TagAwareCacheInterface extends CacheInterface
  18. {
  19. /**
  20. * Invalidates cached items using tags.
  21. *
  22. * When implemented on a PSR-6 pool, invalidation should not apply
  23. * to deferred items. Instead, they should be committed as usual.
  24. * This allows replacing old tagged values by new ones without
  25. * race conditions.
  26. *
  27. * @param string[] $tags An array of tags to invalidate
  28. *
  29. * @return bool True on success
  30. *
  31. * @throws InvalidArgumentException When $tags is not valid
  32. */
  33. public function invalidateTags(array $tags);
  34. }