DefaultFileLocator
in package
implements
FileLocator
Locates the file that contains the metadata information for a given class name.
This behavior is independent of the actual content of the file. It just detects the file which is responsible for the given class name.
Table of Contents
Interfaces
- FileLocator
- Locates the file that contains the metadata information for a given class name.
Properties
- $fileExtension : string|null
- The file extension of mapping documents.
- $paths : array<int, string>
- The paths where to look for mapping files.
Methods
- __construct() : mixed
- Initializes a new FileDriver that looks in the given path(s) for mapping documents and operates in the specified operating mode.
- addPaths() : void
- Appends lookup paths to metadata driver.
- fileExists() : bool
- Checks if a file can be found for this class name.
- findMappingFile() : string
- Locates mapping file for the given class name.
- getAllClassNames() : array<int, string>
- Gets all class names that are found with this file locator.
- getFileExtension() : string|null
- Gets the file extension used to look for mapping files under.
- getPaths() : array<int, string>
- Retrieves the defined metadata lookup paths.
- setFileExtension() : void
- Sets the file extension used to look for mapping files under.
Properties
$fileExtension
The file extension of mapping documents.
protected
string|null
$fileExtension
$paths
The paths where to look for mapping files.
protected
array<int, string>
$paths
= []
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(string|array<int, string> $paths[, string|null $fileExtension = null ]) : mixed
Parameters
- $paths : string|array<int, string>
-
One or multiple paths where mapping documents can be found.
- $fileExtension : string|null = null
-
The file extension of mapping documents, usually prefixed with a dot.
addPaths()
Appends lookup paths to metadata driver.
public
addPaths(array<int, string> $paths) : void
Parameters
- $paths : array<int, string>
fileExists()
Checks if a file can be found for this class name.
public
fileExists(string $className) : bool
Parameters
- $className : string
Return values
boolfindMappingFile()
Locates mapping file for the given class name.
public
findMappingFile(string $className) : string
Parameters
- $className : string
Return values
stringgetAllClassNames()
Gets all class names that are found with this file locator.
public
getAllClassNames(string $globalBasename) : array<int, string>
Parameters
- $globalBasename : string
-
Passed to allow excluding the basename.
Return values
array<int, string>getFileExtension()
Gets the file extension used to look for mapping files under.
public
getFileExtension() : string|null
Return values
string|nullgetPaths()
Retrieves the defined metadata lookup paths.
public
getPaths() : array<int, string>
Return values
array<int, string>setFileExtension()
Sets the file extension used to look for mapping files under.
public
setFileExtension(string|null $fileExtension) : void
Parameters
- $fileExtension : string|null
-
The file extension to set.