class PHPDriver extends FileDriver (View source)

The PHPDriver includes php files which just populate ClassMetadataInfo instances with plain php code

Properties

protected FileLocator $locator from FileDriver
protected array $classCache from FileDriver
protected string $globalBasename from FileDriver
protected $metadata {@inheritdoc}

Methods

__construct($locator, $fileExtension = null)

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

setGlobalBasename($file)

No description

getGlobalBasename()

No description

array
getElement($className)

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

boolean
isTransient(string $className)

Whether the class with the specified name should have its metadata loaded.

array
getAllClassNames()

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

array
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.

void
initialize()

Initialize the class cache from all the global files.

loadMetadataForClass(string $className, ClassMetadata $metadata)

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

Details

__construct($locator, $fileExtension = null)

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

Parameters

$locator
$fileExtension

setGlobalBasename($file)

Parameters

$file

getGlobalBasename()

array getElement($className)

Get 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

$className

Return Value

array $element The element of schema meta data

boolean isTransient(string $className)

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

boolean

array getAllClassNames()

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

Return Value

array The names of all mapped classes known to this driver.

protected array 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

array

protected void initialize()

Initialize 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.

Return Value

void

loadMetadataForClass(string $className, ClassMetadata $metadata)

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

Parameters

string $className
ClassMetadata $metadata