AbstractExporter
in package
Abstract base class which is to be used for the Exporter drivers which can be found in \Doctrine\ORM\Tools\Export\Driver.
Tags
Table of Contents
Properties
- $_extension : string|null
- $_metadata : array<string|int, ClassMetadata>
- $_outputDir : string|null
- $_overwriteExistingFiles : bool
Methods
- __construct() : mixed
- export() : void
- Exports each ClassMetadata instance to a single Doctrine Mapping file named after the entity.
- exportClassMetadata() : string
- Converts a single ClassMetadata instance to the exported format and returns it.
- getExtension() : string|null
- Gets the extension used to generated the path to a class.
- setExtension() : void
- Sets the directory to output the mapping files to.
- setMetadata() : void
- Sets the array of ClassMetadata instances to export.
- setOutputDir() : void
- Sets the directory to output the mapping files to.
- setOverwriteExistingFiles() : void
- _generateOutputPath() : string
- Generates the path to write the class for the given ClassMetadataInfo instance.
- _getChangeTrackingPolicyString() : string
- _getFetchModeString() : string
- _getIdGeneratorTypeString() : string
- _getInheritanceTypeString() : string
Properties
$_extension
protected
string|null
$_extension
$_metadata
protected
array<string|int, ClassMetadata>
$_metadata
= []
$_outputDir
protected
string|null
$_outputDir
$_overwriteExistingFiles
protected
bool
$_overwriteExistingFiles
= false
Methods
__construct()
public
__construct([string|null $dir = null ]) : mixed
Parameters
- $dir : string|null = null
export()
Exports each ClassMetadata instance to a single Doctrine Mapping file named after the entity.
public
export() : void
Tags
exportClassMetadata()
Converts a single ClassMetadata instance to the exported format and returns it.
public
abstract exportClassMetadata(ClassMetadataInfo $metadata) : string
Parameters
- $metadata : ClassMetadataInfo
Return values
stringgetExtension()
Gets the extension used to generated the path to a class.
public
getExtension() : string|null
Return values
string|nullsetExtension()
Sets the directory to output the mapping files to.
public
setExtension(string $extension) : void
[php] $exporter = new YamlExporter($metadata, DIR . '/yaml'); $exporter->setExtension('.yml'); $exporter->export();
Parameters
- $extension : string
setMetadata()
Sets the array of ClassMetadata instances to export.
public
setMetadata(array<string|int, mixed> $metadata) : void
Parameters
- $metadata : array<string|int, mixed>
Tags
setOutputDir()
Sets the directory to output the mapping files to.
public
setOutputDir(string $dir) : void
[php] $exporter = new YamlExporter($metadata); $exporter->setOutputDir(DIR . '/yaml'); $exporter->export();
Parameters
- $dir : string
setOverwriteExistingFiles()
public
setOverwriteExistingFiles(bool $overwrite) : void
Parameters
- $overwrite : bool
_generateOutputPath()
Generates the path to write the class for the given ClassMetadataInfo instance.
protected
_generateOutputPath(ClassMetadataInfo $metadata) : string
Parameters
- $metadata : ClassMetadataInfo
Return values
string_getChangeTrackingPolicyString()
protected
_getChangeTrackingPolicyString(int $policy) : string
Parameters
- $policy : int
Tags
Return values
string_getFetchModeString()
protected
_getFetchModeString(int $mode) : string
Parameters
- $mode : int
Tags
Return values
string_getIdGeneratorTypeString()
protected
_getIdGeneratorTypeString(int $type) : string
Parameters
- $type : int
Tags
Return values
string_getInheritanceTypeString()
protected
_getInheritanceTypeString(int $type) : string
Parameters
- $type : int