protected function addIdentifierToTags($entryIdentifier, array $tags)
{
foreach ($tags as $tag) {
// Update tag-to-identifier index
$identifiers = $this->findIdentifiersByTag($tag);
if (array_search($entryIdentifier, $identifiers) === false) {
$identifiers[] = $entryIdentifier;
apc_store($this->identifierPrefix . 'tag_' . $tag, $identifiers);
}
// Update identifier-to-tag index
$existingTags = $this->findTagsByIdentifier($entryIdentifier);
if (array_search($entryIdentifier, $existingTags) === false) {
apc_store($this->identifierPrefix . 'ident_' . $entryIdentifier, array_merge($existingTags, $tags));
}
}
}