LazyLoadingMetadataFactory
class LazyLoadingMetadataFactory implements MetadataFactoryInterface
Creates new {@link ClassMetadataInterface} instances.
Whenever {@link getMetadataFor()} is called for the first time with a given class name or object of that class, a new metadata instance is created and returned. On subsequent requests for the same class, the same metadata instance will be returned.
You can optionally pass a {@link LoaderInterface} instance to the constructor. Whenever a new metadata instance is created, it is passed to the loader, which can configure the metadata based on configuration loaded from the filesystem or a database. If you want to use multiple loaders, wrap them in a {@link LoaderChain}.
You can also optionally pass a {@link CacheInterface} instance to the constructor. This cache will be used for persisting the generated metadata between multiple PHP requests.
Methods
Creates a new metadata factory.
Returns the metadata for the given value.
Returns whether the class is able to return metadata for the given value.
Details
at line line 71
__construct(LoaderInterface $loader = null, CacheInterface $cache = null)
Creates a new metadata factory.
at line line 92
MetadataInterface
getMetadataFor(mixed $value)
Returns the metadata for the given value.
at line line 141
bool
hasMetadataFor(mixed $value)
Returns whether the class is able to return metadata for the given value.