SimplifiedYamlDriver
extends YamlDriver
in package
YamlDriver that additionally looks for mapping information in a global file.
Tags
Table of Contents
Constants
- DEFAULT_FILE_EXTENSION = '.orm.yml'
Properties
- $classCache : array<string|int, ClassMetadata>|null
- $globalBasename : string
- $locator : FileLocator
Methods
- __construct() : mixed
- Initializes a new FileDriver that looks in the given path(s) for mapping documents and operates in the specified operating mode.
- getAllClassNames() : array<int, string>
- Gets the names of all mapped classes known to this driver.
- getElement() : ClassMetadata
- Gets the element of schema meta data for the class from the mapping file.
- getGlobalBasename() : string|null
- Retrieves the global basename.
- getLocator() : FileLocator
- Retrieves the locator used to discover mapping files by className.
- isTransient() : bool
- Returns whether the class with the specified name should have its metadata loaded.
- loadMetadataForClass() : mixed
- {@inheritDoc}
- setGlobalBasename() : void
- Sets the global basename.
- setLocator() : void
- Sets the locator used to discover mapping files by className.
- initialize() : void
- Initializes the class cache from all the global files.
- loadMappingFile() : array<string|int, ClassMetadata>
- Loads a mapping file with the given name and returns a map from class/entity names to their corresponding file driver elements.
- cacheToArray() : array<string|int, mixed>
- Parse / Normalize the cache configuration
- columnToArray() : array<string|int, mixed>
- Parses the given column as array.
- joinColumnToArray() : array<string|int, mixed>
- Constructs a joinColumn mapping array based on the information found in the given join column element.
Constants
DEFAULT_FILE_EXTENSION
public
mixed
DEFAULT_FILE_EXTENSION
= '.orm.yml'
Properties
$classCache
protected
array<string|int, ClassMetadata>|null
$classCache
Tags
$globalBasename
protected
string
$globalBasename
= ''
$locator
protected
FileLocator
$locator
Methods
__construct()
Initializes a new FileDriver that looks in the given path(s) for mapping documents and operates in the specified operating mode.
public
__construct(mixed $prefixes[, mixed $fileExtension = self::DEFAULT_FILE_EXTENSION ]) : mixed
Parameters
- $prefixes : mixed
- $fileExtension : mixed = self::DEFAULT_FILE_EXTENSION
getAllClassNames()
Gets the names of all mapped classes known to this driver.
public
getAllClassNames() : array<int, string>
Return values
array<int, string> —The names of all mapped classes known to this driver.
getElement()
Gets the element of schema meta data for the class from the mapping file.
public
getElement(string $className) : ClassMetadata
This will lazily load the mapping file if it is not loaded yet.
Parameters
- $className : string
Tags
Return values
ClassMetadata —The element of schema meta data.
getGlobalBasename()
Retrieves the global basename.
public
getGlobalBasename() : string|null
Return values
string|nullgetLocator()
Retrieves the locator used to discover mapping files by className.
public
getLocator() : FileLocator
Return values
FileLocatorisTransient()
Returns whether the class with the specified name should have its metadata loaded.
public
isTransient(string $className) : bool
Parameters
- $className : string
Return values
boolloadMetadataForClass()
{@inheritDoc}
public
loadMetadataForClass(mixed $className, ClassMetadata $metadata) : mixed
Parameters
- $className : mixed
- $metadata : ClassMetadata
Tags
setGlobalBasename()
Sets the global basename.
public
setGlobalBasename(string $file) : void
Parameters
- $file : string
setLocator()
Sets the locator used to discover mapping files by className.
public
setLocator(FileLocator $locator) : void
Parameters
- $locator : FileLocator
initialize()
Initializes the class cache from all the global files.
protected
initialize() : void
Using this feature adds a substantial performance hit to file drivers as more metadata has to be loaded into memory than might actually be necessary. This may not be relevant to scenarios where caching of metadata is in place, however hits very hard in scenarios where no caching is used.
loadMappingFile()
Loads a mapping file with the given name and returns a map from class/entity names to their corresponding file driver elements.
protected
abstract loadMappingFile(string $file) : array<string|int, ClassMetadata>
Parameters
- $file : string
-
The mapping file to load.
Tags
Return values
array<string|int, ClassMetadata>cacheToArray()
Parse / Normalize the cache configuration
private
cacheToArray(array<string|int, mixed> $cacheMapping) : array<string|int, mixed>
Parameters
- $cacheMapping : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>columnToArray()
Parses the given column as array.
private
columnToArray(string $fieldName, array<string|int, mixed>|null $column) : array<string|int, mixed>
Parameters
- $fieldName : string
- $column : array<string|int, mixed>|null
Tags
Return values
array<string|int, mixed>joinColumnToArray()
Constructs a joinColumn mapping array based on the information found in the given join column element.
private
joinColumnToArray(array<string|int, mixed> $joinColumnElement) : array<string|int, mixed>
Parameters
- $joinColumnElement : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —The mapping array.