AnnotationDriver
extends CompatibilityAnnotationDriver
in package
Uses
ColocatedMappingDriver
The AnnotationDriver reads the mapping metadata from docblock annotations.
Table of Contents
Properties
- $classNames : array<int, string>|null
- Cache for getAllClassNames().
- $entityAnnotationClasses : array<string|int, int>
- $excludePaths : array<int, string>
- The paths excluded from path where to look for mapping files.
- $fileExtension : string
- The file extension of mapping documents.
- $paths : array<int, string>
- The paths where to look for mapping files.
Methods
- __construct() : mixed
- Initializes a new AnnotationDriver that uses the given AnnotationReader for reading docblock annotations.
- addExcludePaths() : void
- Append exclude lookup paths to metadata driver.
- addPaths() : void
- Appends lookup paths to metadata driver.
- create() : AnnotationDriver
- Factory method for the Annotation Driver.
- getAllClassNames() : array<string|int, string>
- Gets the names of all mapped classes known to this driver.
- getExcludePaths() : array<int, string>
- Retrieve the defined metadata lookup exclude paths.
- getFileExtension() : string
- Gets the file extension used to look for mapping files under.
- getPaths() : array<int, string>
- Retrieves the defined metadata lookup paths.
- getReader() : Reader
- Retrieve the current annotation reader
- isTransient() : mixed
- {@inheritDoc}
- loadMetadataForClass() : mixed
- {@inheritDoc}
- setFileExtension() : void
- Sets the file extension used to look for mapping files under.
- columnToArray() : array<string|int, mixed>
- Parse the given Column as array
- getFetchMode() : int
- Attempts to resolve the fetch mode.
- getGeneratedMode() : int
- Attempts to resolve the generated mode.
- getMethodCallbacks() : array<int, array{: string, : string}>
- Parses the given method.
- joinColumnToArray() : array<string|int, mixed>
- Parse the given JoinColumn as array
- loadRelationShipMapping() : void
Properties
$classNames
Cache for getAllClassNames().
protected
array<int, string>|null
$classNames
Tags
$entityAnnotationClasses
protected
array<string|int, int>
$entityAnnotationClasses
= [\Doctrine\ORM\Mapping\Entity::class => 1, \Doctrine\ORM\Mapping\MappedSuperclass::class => 2]
Tags
$excludePaths
The paths excluded from path where to look for mapping files.
protected
array<int, string>
$excludePaths
= []
$fileExtension
The file extension of mapping documents.
protected
string
$fileExtension
= '.php'
$paths
The paths where to look for mapping files.
protected
array<int, string>
$paths
= []
Methods
__construct()
Initializes a new AnnotationDriver that uses the given AnnotationReader for reading docblock annotations.
public
__construct(Reader $reader[, string|array<string|int, string>|null $paths = null ]) : mixed
Parameters
- $reader : Reader
-
The AnnotationReader to use
- $paths : string|array<string|int, string>|null = null
-
One or multiple paths where mapping classes can be found.
addExcludePaths()
Append exclude lookup paths to metadata driver.
public
addExcludePaths(array<string|int, string> $paths) : void
Parameters
- $paths : array<string|int, string>
addPaths()
Appends lookup paths to metadata driver.
public
addPaths(array<int, string> $paths) : void
Parameters
- $paths : array<int, string>
create()
Factory method for the Annotation Driver.
public
static create([array<string|int, mixed>|string $paths = [] ][, AnnotationReader|null $reader = null ]) : AnnotationDriver
Parameters
- $paths : array<string|int, mixed>|string = []
- $reader : AnnotationReader|null = null
Return values
AnnotationDrivergetAllClassNames()
Gets the names of all mapped classes known to this driver.
public
getAllClassNames() : array<string|int, string>
Tags
Return values
array<string|int, string> —The names of all mapped classes known to this driver.
getExcludePaths()
Retrieve the defined metadata lookup exclude paths.
public
getExcludePaths() : array<int, string>
Return values
array<int, string>getFileExtension()
Gets the file extension used to look for mapping files under.
public
getFileExtension() : string
Return values
stringgetPaths()
Retrieves the defined metadata lookup paths.
public
getPaths() : array<int, string>
Return values
array<int, string>getReader()
Retrieve the current annotation reader
public
getReader() : Reader
Return values
ReaderisTransient()
{@inheritDoc}
public
isTransient(mixed $className) : mixed
Parameters
- $className : mixed
loadMetadataForClass()
{@inheritDoc}
public
loadMetadataForClass(mixed $className, ClassMetadata $metadata) : mixed
Parameters
- $className : mixed
- $metadata : ClassMetadata
Tags
setFileExtension()
Sets the file extension used to look for mapping files under.
public
setFileExtension(string $fileExtension) : void
Parameters
- $fileExtension : string
columnToArray()
Parse the given Column as array
private
columnToArray(string $fieldName, Column $column) : array<string|int, mixed>
Parameters
- $fieldName : string
- $column : Column
Tags
Return values
array<string|int, mixed>getFetchMode()
Attempts to resolve the fetch mode.
private
getFetchMode(class-string $className, string $fetchMode) : int
Parameters
- $className : class-string
- $fetchMode : string
Tags
Return values
intgetGeneratedMode()
Attempts to resolve the generated mode.
private
getGeneratedMode(string $generatedMode) : int
Parameters
- $generatedMode : string
Tags
Return values
intgetMethodCallbacks()
Parses the given method.
private
getMethodCallbacks(ReflectionMethod $method) : array<int, array{: string, : string}>
Parameters
- $method : ReflectionMethod
Tags
Return values
array<int, array{: string, : string}>joinColumnToArray()
Parse the given JoinColumn as array
private
joinColumnToArray(JoinColumn $joinColumn) : array<string|int, mixed>
Parameters
- $joinColumn : JoinColumn
Tags
Return values
array<string|int, mixed>loadRelationShipMapping()
private
loadRelationShipMapping(ReflectionProperty $property, array<string, mixed> &$mapping, ClassMetadata $metadata, array<string|int, mixed> $joinColumns, class-string $className) : void
Parameters
- $property : ReflectionProperty
- $mapping : array<string, mixed>
- $metadata : ClassMetadata
- $joinColumns : array<string|int, mixed>
- $className : class-string