/** * Deletes the elements of the sorted set stored at the specified key which have rank in the range [start,end]. * * @param string $key * @param int $start * @param int $end * * @return int The number of values deleted from the sorted set * @link http://redis.io/commands/zremrangebyrank * @example * <pre> * $redis->zAdd('key', 1, 'one'); * $redis->zAdd('key', 2, 'two'); * $redis->zAdd('key', 3, 'three'); * $redis->zRemRangeByRank('key', 0, 1); // 2 * $redis->zRange('key', 0, -1, array('withscores' => TRUE)); // array('three' => 3) * </pre> */ public function zRemRangeByRank($key, $start, $end) { try { return $this->client->zRemRangeByRank($key, $start, $end); } catch (Exception $e) { return $this->handleException($e, __FUNCTION__, func_get_args()); } }
/** * Deletes the elements of the sorted set stored at the specified key which have rank in the range [start,end]. * * @param string $key * @param int $start * @param int $end * * @return int The number of values deleted from the sorted set * @link http://redis.io/commands/zremrangebyrank * @example * <pre> * $redis->zAdd('key', 1, 'one'); * $redis->zAdd('key', 2, 'two'); * $redis->zAdd('key', 3, 'three'); * $redis->zRemRangeByRank('key', 0, 1); // 2 * $redis->zRange('key', 0, -1, array('withscores' => TRUE)); // array('three' => 3) * </pre> */ public function zRemRangeByRank($key, $start, $end) { $this->appendToLog('ZREMRANGEBYRANK ' . $key . ' ' . $start . ' ' . $end); return $this->client->zRemRangeByRank($key, $start, $end); }