/**
* Registers a cache so it can be retrieved at a later point.
*
* @param FrontendInterface $cache The cache frontend to be registered
* @param bool $persistent
* @return void
* @throws DuplicateIdentifierException if a cache with the given identifier has already been registered.
* @api
*/
public function registerCache(FrontendInterface $cache, $persistent = false)
{
$identifier = $cache->getIdentifier();
if (isset($this->caches[$identifier])) {
throw new DuplicateIdentifierException('A cache with identifier "' . $identifier . '" has already been registered.', 1203698223);
}
$this->caches[$identifier] = $cache;
if ($persistent === true) {
$this->persistentCaches[$identifier] = $cache;
}
}