/**
* Increment of given $keyName by $value
*
* @param string $keyName
* @param int $value
* @return int|false
*/
public function increment($keyName = null, $value = null)
{
if ($keyName === null) {
$prefixedKey = $this->_lastKey;
} else {
$prefixedKey = $this->getPrefixedIdentifier($keyName);
}
if (!$prefixedKey) {
return false;
}
$this->_lastKey = $prefixedKey;
if (!$value) {
$value = 1;
}
$aKey = $this->buildKey($prefixedKey);
$this->db->increment($aKey, 'value', $value);
$status = $this->db->get($aKey, $cache);
if ($status != AerospikeDb::OK) {
return false;
}
return $cache['bins']['value'];
}