You are here

public function DrupalMemcacheInterface::add in Memcache API and Integration 8.2

Add an item to Memcache if it doesn't exist already.

Parameters

string $key: The key to add.

mixed $value: The value to add.

int $expire: The expiration time in seconds.

Return value

bool TRUE on success or FALSE on failure.

2 methods override DrupalMemcacheInterface::add()
MemcachedDriver::add in src/Driver/MemcachedDriver.php
Add an item to Memcache if it doesn't exist already.
MemcacheDriver::add in src/Driver/MemcacheDriver.php
Add an item to Memcache if it doesn't exist already.

File

src/DrupalMemcacheInterface.php, line 79

Class

DrupalMemcacheInterface
Class DrupalMemcacheInterface.

Namespace

Drupal\memcache

Code

public function add($key, $value, $expire = 0);