protected function removeIdentifierFromAllTags($entryIdentifier)
{
// Get tags for this identifier
$tags = $this->findTagsByIdentifier($entryIdentifier);
// Deassociate tags with this identifier
foreach ($tags as $tag) {
$identifiers = $this->findIdentifiersByTag($tag);
// Formally array_search() below should never return false due to
// the behavior of findTagsByIdentifier(). But if reverse index is
// corrupted, we still can get 'false' from array_search(). This is
// not a problem because we are removing this identifier from
// anywhere.
if (($key = array_search($entryIdentifier, $identifiers)) !== false) {
unset($identifiers[$key]);
if (count($identifiers)) {
apc_store($this->identifierPrefix . 'tag_' . $tag, $identifiers);
} else {
apc_delete($this->identifierPrefix . 'tag_' . $tag);
}
}
}
// Clear reverse tag index for this identifier
apc_delete($this->identifierPrefix . 'ident_' . $entryIdentifier);
}