class DisconnectedMetadataFactory (View source)

This class provides methods to access Doctrine entity class metadata for a given bundle, namespace or entity class, for generation purposes

Methods

__construct(ManagerRegistry $registry)

No description

getBundleMetadata(BundleInterface $bundle)

Gets the metadata of all classes of a bundle.

getClassMetadata(string $class, string $path = null)

Gets the metadata of a class.

getNamespaceMetadata(string $namespace, string $path = null)

Gets the metadata of all classes of a namespace.

findNamespaceAndPathForMetadata(ClassMetadataCollection $metadata, $path = null)

Find and configure path and namespace for the metadata collection.

Details

__construct(ManagerRegistry $registry)

Parameters

ManagerRegistry $registry A ManagerRegistry instance

ClassMetadataCollection getBundleMetadata(BundleInterface $bundle)

Gets the metadata of all classes of a bundle.

Parameters

BundleInterface $bundle A BundleInterface instance

Return Value

ClassMetadataCollection A ClassMetadataCollection instance

Exceptions

RuntimeException When bundle does not contain mapped entities.

ClassMetadataCollection getClassMetadata(string $class, string $path = null)

Gets the metadata of a class.

Parameters

string $class A class name
string $path The path where the class is stored (if known)

Return Value

ClassMetadataCollection A ClassMetadataCollection instance

Exceptions

MappingException When class is not valid entity or mapped superclass.

ClassMetadataCollection getNamespaceMetadata(string $namespace, string $path = null)

Gets the metadata of all classes of a namespace.

Parameters

string $namespace A namespace name
string $path The path where the class is stored (if known)

Return Value

ClassMetadataCollection A ClassMetadataCollection instance

Exceptions

RuntimeException When namespace not contain mapped entities.

findNamespaceAndPathForMetadata(ClassMetadataCollection $metadata, $path = null)

Find and configure path and namespace for the metadata collection.

Parameters

ClassMetadataCollection $metadata
$path

Exceptions

RuntimeException When unable to determine the path.