Jamm\Memory\CouchbaseObject::setTags PHP Метод

setTags() защищенный Метод

protected setTags ( string $key, array | string $tags ) : boolean
$key string
$tags array | string
Результат boolean
    protected function setTags($key, $tags)
    {
        if (!is_array($tags)) {
            $tags = array($tags);
        }
        foreach ($tags as $tag) {
            try {
                if (!$this->Couchbase->add($this->tag_prefix . $tag, '"' . addcslashes($key, '\\') . '"')) {
                    $this->Couchbase->append($this->tag_prefix . $tag, ',"' . addcslashes($key, '\\') . '"');
                }
            } catch (\Exception $Exception) {
                $this->ReportError('Can\'t set tag ' . $tag . ' for key ' . $key, __LINE__);
            }
        }
        return true;
    }