CacheEvent.php 741B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace Illuminate\Cache\Events;
  3. abstract class CacheEvent
  4. {
  5. /**
  6. * The key of the event.
  7. *
  8. * @var string
  9. */
  10. public $key;
  11. /**
  12. * The tags that were assigned to the key.
  13. *
  14. * @var array
  15. */
  16. public $tags;
  17. /**
  18. * Create a new event instance.
  19. *
  20. * @param string $key
  21. * @param array $tags
  22. * @return void
  23. */
  24. public function __construct($key, array $tags = [])
  25. {
  26. $this->key = $key;
  27. $this->tags = $tags;
  28. }
  29. /**
  30. * Set the tags for the cache event.
  31. *
  32. * @param array $tags
  33. * @return $this
  34. */
  35. public function setTags($tags)
  36. {
  37. $this->tags = $tags;
  38. return $this;
  39. }
  40. }