Gets the metadata factory used to gather the metadata of classes.
public getMetadataFactory ( ) : Doctrine\ORM\Mapping\ClassMetadataFactory | ||
return | Doctrine\ORM\Mapping\ClassMetadataFactory |
use Doctrine\ORM\EntityManager; $entityManager = EntityManager::create($connectionParams, $config); $metadataFactory = $entityManager->getMetadataFactory(); $metadata = $metadataFactory->getMetadataFor('My\Entity\MyEntity'); // Use the metadata to access information about the entity's properties, associations, etc.
use Doctrine\ORM\EntityManager; $entityManager = EntityManager::create($connectionParams, $config); $metadataFactory = $entityManager->getMetadataFactory(); $allMetadata = $metadataFactory->getAllMetadata(); // Loop through the metadata and use it to access information about each entity's properties, associations, etc. foreach ($allMetadata as $metadata) { // ... }These examples demonstrate how the getMetadataFactory method of the EntityManager class can be used to retrieve information about entities managed by the ORM. This package library is commonly used in web development and is available via Composer for easy installation.
public getMetadataFactory ( ) : Doctrine\ORM\Mapping\ClassMetadataFactory | ||
return | Doctrine\ORM\Mapping\ClassMetadataFactory |