/** * {@inheritDoc} */ public function has($identifier, $type = null, $unique = null) { if (!is_null($type) && !is_null($unique)) { $identifier = base64_encode(implode(':', [$identifier, $type, $unique])); } return $this->redis->hexists('aggregator:objects', $identifier); }
public function limitRate($key) { if (!$this->client->hexists($key, 'limit')) { return false; } $this->client->hincrby($key, 'calls', 1); return $this->getRateInfo($key); }
/** * @param string $name * @return bool */ public function has($name) { if (ArrayUtils::hasInArray($this->conf, $name)) { return true; } else { if ($this->redis) { $f = $this->getField($name); $b = $this->redis->hexists($this->key, $f); if ($b) { $v = $this->redis->hget($this->key, $f); $this->conf[$f] = unserialize($v); return ArrayUtils::hasInArray($this->conf, $name); } } } return false; }
/** * @param $key * @param $field * @return bool */ public function existsInHTable($key, $field) { return 1 === $this->redis->hexists($key, $field); }