ContextCacheKeys.php 666 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace Drupal\Core\Cache\Context;
  3. use Drupal\Core\Cache\CacheableMetadata;
  4. /**
  5. * A value object to store generated cache keys with its cacheability metadata.
  6. */
  7. class ContextCacheKeys extends CacheableMetadata {
  8. /**
  9. * The generated cache keys.
  10. *
  11. * @var string[]
  12. */
  13. protected $keys;
  14. /**
  15. * Constructs a ContextCacheKeys object.
  16. *
  17. * @param string[] $keys
  18. * The cache context keys.
  19. */
  20. public function __construct(array $keys) {
  21. $this->keys = $keys;
  22. }
  23. /**
  24. * Gets the generated cache keys.
  25. *
  26. * @return string[]
  27. * The cache keys.
  28. */
  29. public function getKeys() {
  30. return $this->keys;
  31. }
  32. }