Bluz\Cache\Cache::addTag PHP Method

addTag() public method

public addTag ( string $id, string $tag ) : boolean
$id string
$tag string
return boolean
    public function addTag($id, $tag)
    {
        $tag = $this->tagPrefix . $tag;
        if ($this->getTagAdapter()->contains($tag)) {
            $identifiers = $this->getTagAdapter()->get($tag);
        } else {
            $identifiers = [];
        }
        // array may contain not unique values, but I can't see problem here
        $identifiers[] = $this->prepareId($id);
        return $this->getTagAdapter()->set($tag, $identifiers);
    }