abstract class AnnotationDriver implements MappingDriver (View source)

The AnnotationDriver reads the mapping metadata from docblock annotations.

Properties

protected Reader $reader The annotation reader.
protected string[] $paths The paths where to look for mapping files.
protected string[] $excludePaths The paths excluded from path where to look for mapping files.
protected string $fileExtension The file extension of mapping documents.
protected string[]|null $classNames Cache for AnnotationDriver#getAllClassNames().
protected string[] $entityAnnotationClasses Name of the entity annotations as keys.

Methods

__construct(Reader $reader, string|string[]|null $paths = null)

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

void
addPaths(array $paths)

Appends lookup paths to metadata driver.

string[]
getPaths()

Retrieves the defined metadata lookup paths.

addExcludePaths(array $paths)

Append exclude lookup paths to metadata driver.

string[]
getExcludePaths()

Retrieve the defined metadata lookup exclude paths.

Reader
getReader()

Retrieve the current annotation reader

string
getFileExtension()

Gets the file extension used to look for mapping files under.

void
setFileExtension(string $fileExtension)

Sets the file extension used to look for mapping files under.

bool
isTransient(string $className)

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.

string[]
getAllClassNames()

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

Details

__construct(Reader $reader, string|string[]|null $paths = null)

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

Parameters

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

void addPaths(array $paths)

Appends lookup paths to metadata driver.

Parameters

array $paths

Return Value

void

string[] getPaths()

Retrieves the defined metadata lookup paths.

Return Value

string[]

addExcludePaths(array $paths)

Append exclude lookup paths to metadata driver.

Parameters

array $paths

string[] getExcludePaths()

Retrieve the defined metadata lookup exclude paths.

Return Value

string[]

Reader getReader()

Retrieve the current annotation reader

Return Value

Reader

string getFileExtension()

Gets the file extension used to look for mapping files under.

Return Value

string

void setFileExtension(string $fileExtension)

Sets the file extension used to look for mapping files under.

Parameters

string $fileExtension The file extension to set.

Return Value

void

bool isTransient(string $className)

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.

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

Parameters

string $className

Return Value

bool

string[] getAllClassNames()

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

Return Value

string[] The names of all mapped classes known to this driver.