Jamm\Memory\RedisObject::del_by_tags PHP Method

del_by_tags() public method

Delete keys by tags
public del_by_tags ( array | string $tags ) : boolean
$tags array | string - tag or array of tags
return boolean
    public function del_by_tags($tags)
    {
        if (!is_array($tags)) {
            $tags = array($tags);
        }
        $d = 0;
        foreach ($tags as $tag) {
            $keys = $this->redis->sMembers($this->tag_prefix . $tag);
            if (!empty($keys)) {
                $d += $this->del($keys);
            }
            $this->redis->Del($this->tag_prefix . $tag);
        }
        return $d;
    }