You are here

public function DatabaseStorageList::set in Key-value Extensions 8

Parameters

float $key:

mixed $value:

Overrides KeyValueStoreListInterface::set

File

src/KeyValueStore/DatabaseStorageList.php, line 50

Class

DatabaseStorageList

Namespace

Drupal\key_value\KeyValueStore

Code

public function set($key, $value) {
  $this->connection
    ->update($this->table)
    ->fields([
    'value' => $this->serializer
      ->encode($value),
  ])
    ->condition('collection', $this->collection)
    ->condition('name', (int) $key)
    ->execute();
}