abstract class AnnotationDriver implements MappingDriver (View source)

The AnnotationDriver reads the mapping metadata from docblock annotations.

Properties

protected AnnotationReader $reader The AnnotationReader.
protected array $paths The paths where to look for mapping files.
protected string $fileExtension The file extension of mapping documents.
protected array $classNames Cache for AnnotationDriver#getAllClassNames()
protected array $entityAnnotationClasses Name of the entity annotations as keys

Methods

__construct(AnnotationReader $reader, string|array $paths = null)

Initializes a new AnnotationDriver that uses the given AnnotationReader for reading docblock annotations.

addPaths(array $paths)

Append lookup paths to metadata driver.

array
getPaths()

Retrieve the defined metadata lookup paths.

getReader()

Retrieve the current annotation reader

void
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

boolean
isTransient(string $className)

Whether the class with the specified name is transient. Only non-transient classes, that is entities and mapped superclasses, should have their metadata loaded.

array
getAllClassNames()

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

Details

__construct(AnnotationReader $reader, string|array $paths = null)

Initializes a new AnnotationDriver that uses the given AnnotationReader for reading docblock annotations.

Parameters

AnnotationReader $reader The AnnotationReader to use, duck-typed.
string|array $paths One or multiple paths where mapping classes can be found.

addPaths(array $paths)

Append lookup paths to metadata driver.

Parameters

array $paths

array getPaths()

Retrieve the defined metadata lookup paths.

Return Value

array

AnnotationReader getReader()

Retrieve the current annotation reader

Return Value

AnnotationReader

void getFileExtension()

Get the file extension used to look for mapping files under

Return Value

void

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

boolean isTransient(string $className)

Whether the class with the specified name is transient. Only non-transient classes, that is entities and mapped superclasses, should have their metadata loaded.

A class is non-transient if it is annotated with an annotation from the {see AnnotationDriver::entityAnnotationClasses}.

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.