Neos\Cache\Backend\ApcBackend::addIdentifierToTags PHP Method

addIdentifierToTags() protected method

Associates the identifier with the given tags
protected addIdentifierToTags ( string $entryIdentifier, array $tags ) : void
$entryIdentifier string
$tags array
return void
    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));
            }
        }
    }