Documentation

YamlExporter extends AbstractExporter
in package

ClassMetadata exporter for Doctrine YAML 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
yamlDump()  : string
Dumps a PHP array to a YAML string.
processEntityListenerConfig()  : array<string|int, mixed>
processEntityListeners()  : array<string|int, mixed>

Properties

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

yamlDump()

Dumps a PHP array to a YAML string.

protected yamlDump(array<string|int, mixed> $array[, int $inline = 2 ]) : string

The yamlDump method, when supplied with an array, will do its best to convert the array into friendly YAML.

Parameters
$array : array<string|int, mixed>

PHP array

$inline : int = 2

[optional] The level where you switch to inline YAML

Return values
string

A YAML string representing the original PHP array

processEntityListenerConfig()

private processEntityListenerConfig(array<string|int, mixed> $array, array<string|int, mixed> $entityListenerConfig, string $event) : array<string|int, mixed>
Parameters
$array : array<string|int, mixed>
$entityListenerConfig : array<string|int, mixed>
$event : string
Tags
psalm-param

array{entityListeners: array<class-string, array<string, array{string}>>} $array

psalm-param

list<array{class: class-string, method: string}> $entityListenerConfig

psalm-return

array{entityListeners: array<class-string, array<string, array{string}>>}

Return values
array<string|int, mixed>

processEntityListeners()

private processEntityListeners(ClassMetadataInfo $metadata, array<string|int, mixed> $array) : array<string|int, mixed>
Parameters
$metadata : ClassMetadataInfo
$array : array<string|int, mixed>
Tags
psalm-param

array<string, mixed> $array

psalm-return

array<string, mixed>&array{entityListeners: array<class-string, array<string, array{string}>>}

Return values
array<string|int, mixed>

        
On this page

Search results