Get metadata for class (annotation, yml, xml and other) in Symfony2 app with Doctrine

The common case for application that used Doctrine2 is get metadata from class. This very simple, you only need inject manager (document or entity) in your service, and than simply use:

$this->documentManager->getMetadataFactory()->getMetadataForClass($class);

 

Comments