StorageBase.php in Drupal 8
File
core/lib/Drupal/Core/KeyValueStore/StorageBase.php
View source
<?php
namespace Drupal\Core\KeyValueStore;
abstract class StorageBase implements KeyValueStoreInterface {
protected $collection;
public function __construct($collection) {
$this->collection = $collection;
}
public function getCollectionName() {
return $this->collection;
}
public function get($key, $default = NULL) {
$values = $this
->getMultiple([
$key,
]);
return isset($values[$key]) ? $values[$key] : $default;
}
public function setMultiple(array $data) {
foreach ($data as $key => $value) {
$this
->set($key, $value);
}
}
public function delete($key) {
$this
->deleteMultiple([
$key,
]);
}
}
Classes
Name |
Description |
StorageBase |
Provides a base class for key/value storage implementations. |