Jamm\Memory\RedisObject::setTags PHP Method

setTags() public method

Set tags, associated with the key
public setTags ( string $key, string | array $tags ) : boolean
$key string
$tags string | array
return boolean
    public function setTags($key, $tags)
    {
        if (!is_array($tags)) {
            $tags = array($tags);
        }
        foreach ($tags as $tag) {
            if (!$this->redis->sAdd($this->tag_prefix . $tag, $key)) {
                return false;
            }
        }
        return true;
    }