Created
March 28, 2013 17:43
-
-
Save ThamaraHessel/5265292 to your computer and use it in GitHub Desktop.
Dúvida de Vinicius Feitosa:
[Doctrine ORM 2.+]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$em->getConfiguration()->setMetadataDriverImpl( | |
new \Doctrine\ORM\Mapping\Driver\DatabaseDriver( | |
$em->getConnection()->getSchemaManager() | |
) | |
); | |
$cmf = new Doctrine\ORM\Tools\DisconnectedClassMetadataFactory(); | |
$cmf->setEntityManager($em); | |
$metadata = $cmf->getAllMetadata(); | |
$cme = new \Doctrine\ORM\Tools\Export\ClassMetadataExporter(); | |
$entityGenerator = new \Doctrine\ORM\Tools\EntityGenerator(); | |
$entityGenerator->setAnnotationPrefix(""); | |
$exporter = $cme->getExporter('annotation', __DIR__ . '/entities'); | |
$exporter->setEntityGenerator($entityGenerator); | |
$exporter->setMetadata($metadata); | |
$etg = new \Doctrine\ORM\Tools\EntityGenerator; | |
$exporter->setEntityGenerator($etg); | |
$exporter->export(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment