protected function setTags($key, array $tags = [])
    {
        if (empty($tags)) {
            return;
        }

        foreach ($this->prepareTags($tags) as $tag) {
            if (($keys = $this->storage->get($tag)) !== false) {
                $keys = $this->unserialize($keys);
                if (in_array($key, $keys, true)) {
                    continue;
                }
                $keys[] = $key;
                $this->setInternal($tag, $this->serialize($keys), 0);
                continue;
            }
            $this->setInternal($tag, $this->serialize((array)$key), 0);
        }
    }
protected function setTags($key, array $tags = [])
    {
        if (empty($tags)) {
            return;
        }

        foreach ($this->prepareTags($tags) as $tag) {
            if (($keys = $this->storage->get($tag)) !== false) {
                $keys = $this->unserialize($keys);
                if (in_array($key, $keys, true)) {
                    continue;
                }
                $keys[] = $key;
                $this->setInternal($tag, $this->serialize($keys), 0);
                continue;
            }
            $this->setInternal($tag, $this->serialize((array)$key), 0);
        }
    }
protected function setTags ( $ key , array $ tags = [ ] ) { if ( empty ( $ tags ) ) { return ; } foreach ( $ this -> prepareTags ( $ tags ) as $ tag ) { if ( ( $ keys = $ this -> storage -> get ( $ tag ) ) !== false ) { $ keys = $ this -> unserialize ( $ keys ) ; if ( in_array ( $ key , $ keys , true ) ) { continue ; } $ keys [ ] = $ key ; $ this -> setInternal ( $ tag , $ this -> serialize ( $ keys ) , 0 ) ; continue ; } $ this -> setInternal ( $ tag , $ this -> serialize ( ( array ) $ key ) , 0 ) ; } }
Sets a tags

@param string $key key of cache
@param array $tags list of tags
Sets a tags