Doctrine


Doctrine\ORM\Tools\Export\ClassMetadataExporter
/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php at line 54

Class ClassMetadataExporter

ClassMetadataExporter

public class ClassMetadataExporter

Class used for converting your mapping information between the supported formats: yaml, xml, and php/annotation.

[php] Unify all your mapping information which is written in php, xml, yml and convert it to a single set of yaml files.

$cme = new Doctrine\ORM\Tools\Export\ClassMetadataExporter(); $cme->addMappingSource(__DIR__ . '/Entities'); $cme->addMappingSource(__DIR__ . '/xml'); $cme->addMappingSource(__DIR__ . '/yaml');

$exporter = $cme->getExporter('yaml'); $exporter->setOutputDir(__DIR__ . '/new_yaml');

$exporter->setMetadatas($cme->getMetadatas()); $exporter->export();

License:
http://www.opensource.org/licenses/lgpl-license.php LGPL
See Also:
www.doctrine-project.org
Since:
2.0
Version:
$Revision$
Author:
Jonathan Wage

Constructor Summary

ClassMetadataExporter()

Method Summary
void

addMappingSource(string source, string type)

Add a new mapping directory to the array of directories to convert and export to another format[php] $cme = new Doctrine\ORM\Tools\Export\ClassMetadataExporter(); $cme->addMappingSource(__DIR__ .

AbstractExporter

getExporter(string type, string source)

Get a exporter driver instance

array

getMetadatas()

Get an array of ClassMetadataInfo instances for all the configured mapping directories.

static void

registerExportDriver(string name, string class)

Register a new exporter driver class under a specified name

void

setEntityManager(EntityManager em)

Optionally set the EntityManager instance to get the AnnotationDriver from instead of creating a new instance of the AnnotationDriver

Constructor Detail

/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php at line 64

ClassMetadataExporter

public ClassMetadataExporter()

Method Detail

/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php at line 123

addMappingSource

public void addMappingSource(string source, string type)

Add a new mapping directory to the array of directories to convert and export to another format

[php] $cme = new Doctrine\ORM\Tools\Export\ClassMetadataExporter(); $cme->addMappingSource(__DIR__ . '/yaml'); $cme->addMappingSource($schemaManager);

Parameters:
source - The source for the mapping files
type - The type of mapping files (yml, xml, etc.)

/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php at line 99

getExporter

public AbstractExporter getExporter(string type, string source)

Get a exporter driver instance

Parameters:
type - The type to get (yml, xml, etc.)
source - The directory where the exporter will export to
Returns:
$exporter

/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php at line 135

getMetadatas

public array getMetadatas()

Get an array of ClassMetadataInfo instances for all the configured mapping directories. Reads the mapping directories and populates ClassMetadataInfo instances.

Returns:
$classes

/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php at line 75

registerExportDriver

public static void registerExportDriver(string name, string class)

Register a new exporter driver class under a specified name


/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php at line 87

setEntityManager

public void setEntityManager(EntityManager em)

Optionally set the EntityManager instance to get the AnnotationDriver from instead of creating a new instance of the AnnotationDriver


Doctrine