class YamlExporter extends AbstractExporter (View source)

ClassMetadata exporter for Doctrine YAML mapping files.

Properties

protected array $_metadata from AbstractExporter
protected string|null $_outputDir from AbstractExporter
protected string $_extension
protected bool $_overwriteExistingFiles from AbstractExporter

Methods

__construct(string|null $dir = null)

No description

void
setOverwriteExistingFiles(bool $overwrite)

No description

string
exportClassMetadata(ClassMetadataInfo $metadata)

Converts a single ClassMetadata instance to the exported format and returns it.

void
setMetadata(array $metadata)

Sets the array of ClassMetadataInfo instances to export.

string|null
getExtension()

Gets the extension used to generated the path to a class.

void
setOutputDir(string $dir)

Sets the directory to output the mapping files to.

void
export()

Exports each ClassMetadata instance to a single Doctrine Mapping file named after the entity.

string
_generateOutputPath(ClassMetadataInfo $metadata)

Generates the path to write the class for the given ClassMetadataInfo instance.

void
setExtension(string $extension)

Sets the directory to output the mapping files to.

string
_getInheritanceTypeString(int $type)

No description

string
_getChangeTrackingPolicyString(int $policy)

No description

string
_getIdGeneratorTypeString(int $type)

No description

Details

__construct(string|null $dir = null)

Parameters

string|null $dir

void setOverwriteExistingFiles(bool $overwrite)

Parameters

bool $overwrite

Return Value

void

string exportClassMetadata(ClassMetadataInfo $metadata)

Converts a single ClassMetadata instance to the exported format and returns it.

Parameters

ClassMetadataInfo $metadata

Return Value

string

void setMetadata(array $metadata)

Sets the array of ClassMetadataInfo instances to export.

Parameters

array $metadata

Return Value

void

string|null getExtension()

Gets the extension used to generated the path to a class.

Return Value

string|null

void setOutputDir(string $dir)

Sets the directory to output the mapping files to.

[php] $exporter = new YamlExporter($metadata); $exporter->setOutputDir(DIR . '/yaml'); $exporter->export();

Parameters

string $dir

Return Value

void

void export()

Exports each ClassMetadata instance to a single Doctrine Mapping file named after the entity.

Return Value

void

Exceptions

ExportException

protected string _generateOutputPath(ClassMetadataInfo $metadata)

Generates the path to write the class for the given ClassMetadataInfo instance.

Parameters

ClassMetadataInfo $metadata

Return Value

string

void setExtension(string $extension)

Sets the directory to output the mapping files to.

[php] $exporter = new YamlExporter($metadata, DIR . '/yaml'); $exporter->setExtension('.yml'); $exporter->export();

Parameters

string $extension

Return Value

void

protected string _getInheritanceTypeString(int $type)

Parameters

int $type

Return Value

string

protected string _getChangeTrackingPolicyString(int $policy)

Parameters

int $policy

Return Value

string

protected string _getIdGeneratorTypeString(int $type)

Parameters

int $type

Return Value

string