AnnotationDriver
in package
implements
MappingDriver
The AnnotationDriver reads the mapping metadata from docblock annotations.
Tags
Interfaces, Classes and Traits
- MappingDriver
- Contract for metadata drivers.
Table of Contents
- $classNames : array<string|int, mixed>|null
- Cache for AnnotationDriver#getAllClassNames().
- $entityAnnotationClasses : array<string|int, mixed>
- Name of the entity annotations as keys.
- $excludePaths : array<string|int, mixed>
- The paths excluded from path where to look for mapping files.
- $fileExtension : string
- The file extension of mapping documents.
- $paths : array<string|int, mixed>
- The paths where to look for mapping files.
- $reader : AnnotationReader
- The AnnotationReader.
- __construct() : mixed
- Initializes a new AnnotationDriver that uses the given AnnotationReader for reading docblock annotations.
- addExcludePaths() : mixed
- Append exclude lookup paths to metadata driver.
- addPaths() : void
- Appends lookup paths to metadata driver.
- getAllClassNames() : array<string|int, mixed>
- Gets the names of all mapped classes known to this driver.
- getExcludePaths() : array<string|int, mixed>
- Retrieve the defined metadata lookup exclude paths.
- getFileExtension() : string
- Gets the file extension used to look for mapping files under.
- getPaths() : array<string|int, mixed>
- Retrieves the defined metadata lookup paths.
- getReader() : AnnotationReader
- Retrieve the current annotation reader
- isTransient() : bool
- Returns whether the class with the specified name is transient. Only non-transient classes, that is entities and mapped superclasses, should have their metadata loaded.
- setFileExtension() : void
- Sets the file extension used to look for mapping files under.
Properties
$classNames
Cache for AnnotationDriver#getAllClassNames().
protected
array<string|int, mixed>|null
$classNames
$entityAnnotationClasses
Name of the entity annotations as keys.
protected
array<string|int, mixed>
$entityAnnotationClasses
= []
$excludePaths
The paths excluded from path where to look for mapping files.
protected
array<string|int, mixed>
$excludePaths
= []
$fileExtension
The file extension of mapping documents.
protected
string
$fileExtension
= '.php'
$paths
The paths where to look for mapping files.
protected
array<string|int, mixed>
$paths
= []
$reader
The AnnotationReader.
protected
AnnotationReader
$reader
Methods
__construct()
Initializes a new AnnotationDriver that uses the given AnnotationReader for reading docblock annotations.
public
__construct(AnnotationReader $reader[, string|array<string|int, mixed>|null $paths = null ]) : mixed
Parameters
- $reader : AnnotationReader
-
The AnnotationReader to use, duck-typed.
- $paths : string|array<string|int, mixed>|null = null
-
One or multiple paths where mapping classes can be found.
Return values
mixed —addExcludePaths()
Append exclude lookup paths to metadata driver.
public
addExcludePaths(array<string|int, mixed> $paths) : mixed
Parameters
- $paths : array<string|int, mixed>
Return values
mixed —addPaths()
Appends lookup paths to metadata driver.
public
addPaths(array<string|int, mixed> $paths) : void
Parameters
- $paths : array<string|int, mixed>
Return values
void —getAllClassNames()
Gets the names of all mapped classes known to this driver.
public
getAllClassNames() : array<string|int, mixed>
Return values
array<string|int, mixed> —The names of all mapped classes known to this driver.
getExcludePaths()
Retrieve the defined metadata lookup exclude paths.
public
getExcludePaths() : array<string|int, mixed>
Return values
array<string|int, mixed> —getFileExtension()
Gets the file extension used to look for mapping files under.
public
getFileExtension() : string
Return values
string —getPaths()
Retrieves the defined metadata lookup paths.
public
getPaths() : array<string|int, mixed>
Return values
array<string|int, mixed> —getReader()
Retrieve the current annotation reader
public
getReader() : AnnotationReader
Return values
AnnotationReader —isTransient()
Returns whether the class with the specified name is transient. Only non-transient classes, that is entities and mapped superclasses, should have their metadata loaded.
public
isTransient(string $className) : bool
A class is non-transient if it is annotated with an annotation from the AnnotationDriver::entityAnnotationClasses.
Parameters
- $className : string
Return values
bool —setFileExtension()
Sets the file extension used to look for mapping files under.
public
setFileExtension(string $fileExtension) : void
Parameters
- $fileExtension : string
-
The file extension to set.