public function __construct(array $entityClassesMap, Cache $cache, IMetadataParserFactory $metadataParserFactory, IRepositoryLoader $repositoryLoader)
{
static::$metadata = $cache->derive('metadata')->load($entityClassesMap, function (&$dp) use($entityClassesMap, $metadataParserFactory, $repositoryLoader) {
$metadata = [];
$annotationParser = $metadataParserFactory->create($entityClassesMap);
foreach (array_keys($entityClassesMap) as $className) {
$metadata[$className] = $annotationParser->parseMetadata($className, $dp[Cache::FILES]);
}
$validator = new MetadataValidator();
$validator->validate($metadata, $repositoryLoader);
return $metadata;
});
}