class KeyValueMemoryFactory in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/KeyValueStore/KeyValueMemoryFactory.php \Drupal\Core\KeyValueStore\KeyValueMemoryFactory
- 9 core/lib/Drupal/Core/KeyValueStore/KeyValueMemoryFactory.php \Drupal\Core\KeyValueStore\KeyValueMemoryFactory
Defines the key/value store factory for the memory backend.
Hierarchy
- class \Drupal\Core\KeyValueStore\KeyValueMemoryFactory implements \Drupal\Core\KeyValueStore\KeyValueFactoryInterface
Expanded class hierarchy of KeyValueMemoryFactory
6 files declare their use of KeyValueMemoryFactory
- CronTest.php in core/
tests/ Drupal/ Tests/ Core/ CronTest.php - MatcherDumperTest.php in core/
tests/ Drupal/ KernelTests/ Core/ Routing/ MatcherDumperTest.php - ProviderRepositoryTest.php in core/
modules/ media/ tests/ src/ Unit/ ProviderRepositoryTest.php - RendererBubblingTest.php in core/
tests/ Drupal/ Tests/ Core/ Render/ RendererBubblingTest.php - Contains \Drupal\Tests\Core\Render\RendererBubblingTest.
- RouteProviderTest.php in core/
tests/ Drupal/ KernelTests/ Core/ Routing/ RouteProviderTest.php - Contains \Drupal\KernelTests\Core\Routing\RouteProviderTest.
File
- core/
lib/ Drupal/ Core/ KeyValueStore/ KeyValueMemoryFactory.php, line 8
Namespace
Drupal\Core\KeyValueStoreView source
class KeyValueMemoryFactory implements KeyValueFactoryInterface {
/**
* An array of keyvalue collections that are stored in memory.
*
* @var array
*/
protected $collections = [];
/**
* {@inheritdoc}
*/
public function get($collection) {
if (!isset($this->collections[$collection])) {
$this->collections[$collection] = new MemoryStorage($collection);
}
return $this->collections[$collection];
}
}