Files
michaelschiemer/src/Framework/Database/Metadata/MetadataRegistry.php
Michael Schiemer 55a330b223 Enable Discovery debug logging for production troubleshooting
- Add DISCOVERY_LOG_LEVEL=debug
- Add DISCOVERY_SHOW_PROGRESS=true
- Temporary changes for debugging InitializerProcessor fixes on production
2025-08-11 20:13:26 +02:00

35 lines
739 B
PHP

<?php
declare(strict_types=1);
namespace App\Framework\Database\Metadata;
final class MetadataRegistry
{
private array $metadata = [];
public function __construct(
private readonly MetadataExtractor $extractor
) {
}
public function getMetadata(string $entityClass): EntityMetadata
{
if (! isset($this->metadata[$entityClass])) {
$this->metadata[$entityClass] = $this->extractor->extractMetadata($entityClass);
}
return $this->metadata[$entityClass];
}
public function hasMetadata(string $entityClass): bool
{
return isset($this->metadata[$entityClass]);
}
public function clearCache(): void
{
$this->metadata = [];
}
}