Skip to content

Loading…

DDC-548: Code example for reverse engineering no longer functions #5054

Closed
doctrinebot opened this Issue · 1 comment

2 participants

@doctrinebot

Jira issue originally created by user mjh_ca:

addMappingSource() function no longer exists in \Doctrine\ORM\Tools\Export\ClassMetaDataExporter

This causes the example code at http://www.doctrine-project.org/documentation/manual/2_0/en/tools#reverse-engineering to break;

Example code should probably be:


$em->getConfiguration()->setMetadataDriverImpl(
    new \Doctrine\ORM\Mapping\Driver\DatabaseDriver(
        $em->getConnection()->getSchemaManager()
    )
);

$cmf = new \Doctrine\ORM\Tools\DisconnectedClassMetadataFactory($em);
$metadata = $cmf->getAllMetadata();

$cme = new \Doctrine\ORM\Tools\Export\ClassMetadataExporter();
$exporter = $cme->getExporter('yml', '/path/to/export/yml');
$exporter->setMetadata($metadata);
$exporter->export();

@doctrinebot

Issue was closed with resolution "Fixed"

@jwage jwage was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.0-BETA2 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.