class SimplifiedXmlDriver extends XmlDriver (View source)

XmlDriver that additionally looks for mapping information in a global file.

Constants

DEFAULT_FILE_EXTENSION

Properties

protected FileLocator $locator from FileDriver
protected mixed[]|null $classCache from FileDriver
protected string|null $globalBasename from FileDriver

Methods

__construct($prefixes, string|null $fileExtension = self::DEFAULT_FILE_EXTENSION)

Initializes a new FileDriver that looks in the given path(s) for mapping documents and operates in the specified operating mode.

FileLocator
getLocator()

Retrieves the locator used to discover mapping files by className.

setLocator(FileLocator $locator)

Sets the locator used to discover mapping files by className.

setGlobalBasename(string $file)

Sets the global basename.

string|null
getGlobalBasename()

Retrieves the global basename.

mixed[]
getElement(string $className)

Gets the element of schema meta data for the class from the mapping file.

bool
isTransient(string $className)

Returns whether the class with the specified name should have its metadata loaded.

string[]
getAllClassNames()

Gets the names of all mapped classes known to this driver.

mixed[]
loadMappingFile(string $file)

Loads a mapping file with the given name and returns a map from class/entity names to their corresponding file driver elements.

from XmlDriver
initialize()

Initializes the class cache from all the global files.

void
loadMetadataForClass(string $className, ClassMetadata $metadata, ClassMetadataBuildingContext $metadataBuildingContext)

Loads the metadata for the specified class into the provided container.

from XmlDriver
bool
evaluateBoolean(mixed $element)

No description

from XmlDriver

Details

__construct($prefixes, string|null $fileExtension = self::DEFAULT_FILE_EXTENSION)

Initializes a new FileDriver that looks in the given path(s) for mapping documents and operates in the specified operating mode.

Parameters

$prefixes
string|null $fileExtension

FileLocator getLocator()

Retrieves the locator used to discover mapping files by className.

Return Value

FileLocator

setLocator(FileLocator $locator)

Sets the locator used to discover mapping files by className.

Parameters

FileLocator $locator

setGlobalBasename(string $file)

Sets the global basename.

Parameters

string $file

string|null getGlobalBasename()

Retrieves the global basename.

Return Value

string|null

mixed[] getElement(string $className)

Gets the element of schema meta data for the class from the mapping file.

This will lazily load the mapping file if it is not loaded yet.

Parameters

string $className

Return Value

mixed[] The element of schema meta data.

Exceptions

MappingException

bool isTransient(string $className)

Returns whether the class with the specified name should have its metadata loaded.

This is only the case if it is either mapped as an Entity or a MappedSuperclass.

Parameters

string $className

Return Value

bool

string[] getAllClassNames()

Gets the names of all mapped classes known to this driver.

Return Value

string[] The names of all mapped classes known to this driver.

protected mixed[] loadMappingFile(string $file)

Loads a mapping file with the given name and returns a map from class/entity names to their corresponding file driver elements.

Parameters

string $file The mapping file to load.

Return Value

mixed[]

protected initialize()

Initializes the class cache from all the global files.

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.

void loadMetadataForClass(string $className, ClassMetadata $metadata, ClassMetadataBuildingContext $metadataBuildingContext)

Loads the metadata for the specified class into the provided container.

Parameters

string $className
ClassMetadata $metadata
ClassMetadataBuildingContext $metadataBuildingContext

Return Value

void

protected bool evaluateBoolean(mixed $element)

Parameters

mixed $element

Return Value

bool