class DefaultFileLocator implements FileLocator (View source)

Locate the file that contains the metadata information for a given class name.

This behavior is inpependent of the actual content of the file. It just detects the file which is responsible for the given class name.

Properties

protected array $paths The paths where to look for mapping files.
protected string $fileExtension The file extension of mapping documents.

Methods

__construct($paths, $fileExtension = null)

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

addPaths(array $paths)

Append lookup paths to metadata driver.

array
getPaths()

Retrieve the defined metadata lookup paths.

string
getFileExtension()

Get the file extension used to look for mapping files under

void
setFileExtension(string $fileExtension)

Set the file extension used to look for mapping files under

string
findMappingFile(string $className)

Locate mapping file for the given class name.

array
getAllClassNames(string $globalBasename)

Get all class names that are found with this file locator.

bool
fileExists($className)

Check if a file can be found for this class name.

Details

__construct($paths, $fileExtension = null)

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

Parameters

$paths
$fileExtension

addPaths(array $paths)

Append lookup paths to metadata driver.

Parameters

array $paths

array getPaths()

Retrieve the defined metadata lookup paths.

Return Value

array

string getFileExtension()

Get the file extension used to look for mapping files under

Return Value

string

void setFileExtension(string $fileExtension)

Set the file extension used to look for mapping files under

Parameters

string $fileExtension The file extension to set

Return Value

void

string findMappingFile(string $className)

Locate mapping file for the given class name.

Parameters

string $className

Return Value

string

array getAllClassNames(string $globalBasename)

Get all class names that are found with this file locator.

Parameters

string $globalBasename Passed to allow excluding the basename

Return Value

array

bool fileExists($className)

Check if a file can be found for this class name.

Parameters

$className

Return Value

bool