MemoryBackendFactory.php 412 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace Drupal\Core\Cache;
  3. class MemoryBackendFactory implements CacheFactoryInterface {
  4. /**
  5. * Instantiated memory cache bins.
  6. *
  7. * @var \Drupal\Core\Cache\MemoryBackend[]
  8. */
  9. protected $bins = [];
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function get($bin) {
  14. if (!isset($this->bins[$bin])) {
  15. $this->bins[$bin] = new MemoryBackend();
  16. }
  17. return $this->bins[$bin];
  18. }
  19. }