Documentation

XmlExporter extends AbstractExporter
in package

ClassMetadata exporter for Doctrine XML mapping files.

Tags
deprecated
2.7

This class is being removed from the ORM and won't have any replacement

link
www.doctrine-project.org

Table of Contents

Properties

$_extension  : string
$_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
addClassToMapIfExists()  : SimpleXMLElement
asXml()  : string
exportSequenceInformation()  : void
Export sequence information (if available/configured) into the current identifier XML node
exportTableOptions()  : void
Exports (nested) option elements.
generateEntityListenerXml()  : void
processEntityListeners()  : void

Properties

$_extension

protected string $_extension = '.dcm.xml'

$_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
throws
ExportException

exportClassMetadata()

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

public exportClassMetadata(ClassMetadataInfo $metadata) : string
Parameters
$metadata : ClassMetadataInfo
Return values
string

getExtension()

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

public getExtension() : string|null
Return values
string|null

setExtension()

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
psalm-param

list<ClassMetadata> $metadata

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

_getChangeTrackingPolicyString()

protected _getChangeTrackingPolicyString(int $policy) : string
Parameters
$policy : int
Tags
psalm-param

ClassMetadataInfo::CHANGETRACKING_* $policy

Return values
string

_getFetchModeString()

protected _getFetchModeString(int $mode) : string
Parameters
$mode : int
Tags
psalm-param

ClassMetadataInfo::FETCH_* $mode

Return values
string

_getIdGeneratorTypeString()

protected _getIdGeneratorTypeString(int $type) : string
Parameters
$type : int
Tags
psalm-param

ClassMetadataInfo::GENERATOR_TYPE_* $type

Return values
string

_getInheritanceTypeString()

protected _getInheritanceTypeString(int $type) : string
Parameters
$type : int
Tags
psalm-param

ClassMetadataInfo::INHERITANCE_TYPE_* $type

Return values
string

addClassToMapIfExists()

private addClassToMapIfExists(array<string|int, mixed> $entityListenersXmlMap, array<string|int, mixed> $entityListener, SimpleXMLElement $entityListenersXml) : SimpleXMLElement
Parameters
$entityListenersXmlMap : array<string|int, mixed>
$entityListener : array<string|int, mixed>
$entityListenersXml : SimpleXMLElement
Return values
SimpleXMLElement

asXml()

private asXml(SimpleXMLElement $simpleXml) : string
Parameters
$simpleXml : SimpleXMLElement
Return values
string

exportSequenceInformation()

Export sequence information (if available/configured) into the current identifier XML node

private exportSequenceInformation(SimpleXMLElement $identifierXmlNode, ClassMetadataInfo $metadata) : void
Parameters
$identifierXmlNode : SimpleXMLElement
$metadata : ClassMetadataInfo

exportTableOptions()

Exports (nested) option elements.

private exportTableOptions(SimpleXMLElement $parentXml, array<string|int, mixed> $options) : void
Parameters
$parentXml : SimpleXMLElement
$options : array<string|int, mixed>

generateEntityListenerXml()

private generateEntityListenerXml(ClassMetadataInfo $metadata, array<string|int, mixed> $entityListenersXmlMap, SimpleXMLElement $entityListenersXml) : void
Parameters
$metadata : ClassMetadataInfo
$entityListenersXmlMap : array<string|int, mixed>
$entityListenersXml : SimpleXMLElement

        
On this page

Search results