예제 #1
0
 /**
  * Deletes all keys from associated tags and all priorities
  *
  * @todo optimize
  * @param string $keys
  */
 private function cleanEntry($keys)
 {
     foreach (is_array($keys) ? $keys : [$keys] as $key) {
         $entries = $this->entryTags($key);
         $this->client->multi();
         foreach ($entries as $tag) {
             $this->client->sRem($this->formatKey($tag, self::KEYS), $key);
         }
         // drop tags of entry and priority, in case there are some
         $this->client->del($this->formatKey($key, self::TAGS), $this->formatKey($key, self::PRIORITY));
         $this->client->zRem($this->formatKey(self::PRIORITY), $key);
         $this->client->exec();
     }
 }