Sets the cache for caching class metadata.
CacheInterface $cache The cache instance.:
ValidatorBuilderInterface The builder object.
Overrides ValidatorBuilderInterface::setMetadataCache
public function setMetadataCache(CacheInterface $cache) {
if (null !== $this->metadataFactory) {
throw new ValidatorException('You cannot set a custom metadata cache after setting a custom metadata factory. Configure your metadata factory instead.');
}
$this->metadataCache = $cache;
return $this;
}