Overrides \Drupal\Core\Utility\CacheArray::set().
Overrides CacheArray::set
public function set($data, $lock = TRUE) {
$lock_name = $this->cid . ':' . $this->bin;
if (!$lock || lock()
->acquire($lock_name)) {
if ($cached = cache($this->bin)
->get($this->cid)) {
// Use array merge instead of union so that filled in values in $data
// overwrite empty values in the current cache.
$data = array_merge($cached->data, $data);
}
cache($this->bin)
->set($this->cid, $data);
if ($lock) {
lock()
->release($lock_name);
}
}
}