function DatabaseStorageExpirable::setWithExpireIfNotExists
Same name in other branches
- 9 core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php \Drupal\Core\KeyValueStore\DatabaseStorageExpirable::setWithExpireIfNotExists()
- 10 core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php \Drupal\Core\KeyValueStore\DatabaseStorageExpirable::setWithExpireIfNotExists()
- 11.x core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php \Drupal\Core\KeyValueStore\DatabaseStorageExpirable::setWithExpireIfNotExists()
Overrides KeyValueStoreExpirableInterface::setWithExpireIfNotExists
File
-
core/
lib/ Drupal/ Core/ KeyValueStore/ DatabaseStorageExpirable.php, line 89
Class
- DatabaseStorageExpirable
- Defines a default key/value store implementation for expiring items.
Namespace
Drupal\Core\KeyValueStoreCode
public function setWithExpireIfNotExists($key, $value, $expire) {
if (!$this->has($key)) {
$this->setWithExpire($key, $value, $expire);
return TRUE;
}
return FALSE;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.