public function SecretInfo::setSecretInfo in Lockr 4.x
Same name and namespace in other branches
- 8.4 src/SecretInfo.php \Drupal\lockr\SecretInfo::setSecretInfo()
- 8.3 src/SecretInfo.php \Drupal\lockr\SecretInfo::setSecretInfo()
File
- src/
SecretInfo.php, line 77
Class
- SecretInfo
- SecretInfo implements secret info for Lockr secrets.
Namespace
Drupal\lockrCode
public function setSecretInfo($name, array $info) {
$secret = $this->secretStorage
->load($name);
if (is_null($secret)) {
$secret = $this->secretStorage
->create([
'id' => $name,
'key_id' => $name,
]);
}
$secret
->setInfo($info);
$secret
->save();
}