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;
}