Documentation

AttributeDriver extends CompatibilityAnnotationDriver
in package
Uses ColocatedMappingDriver

Table of Contents

Constants

ENTITY_ATTRIBUTE_CLASSES  = [\Doctrine\ORM\Mapping\Entity::class => 1, \Doctrine\ORM\Mapping\MappedSuperclass::class => 2]

Properties

$classNames  : array<int, string>|null
Cache for getAllClassNames().
$entityAnnotationClasses  : array<MappingAttribute>, 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
addExcludePaths()  : void
Append exclude lookup paths to metadata driver.
addPaths()  : void
Appends lookup paths to metadata 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()  : AttributeReader
Retrieve the current annotation reader
isTransient()  : mixed
{@inheritDoc}
loadMetadataForClass()  : void
{@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()  : ClassMetadata::FETCH_*
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

Constants

ENTITY_ATTRIBUTE_CLASSES

private mixed ENTITY_ATTRIBUTE_CLASSES = [\Doctrine\ORM\Mapping\Entity::class => 1, \Doctrine\ORM\Mapping\MappedSuperclass::class => 2]

Properties

$classNames

Cache for getAllClassNames().

protected array<int, string>|null $classNames
Tags
psalm-var

list|null

$entityAnnotationClasses

protected array<MappingAttribute>, int> $entityAnnotationClasses = self::ENTITY_ATTRIBUTE_CLASSES
Tags
deprecated

override isTransient() instead of overriding this property

$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'

Methods

__construct()

public __construct(array<string|int, string> $paths) : mixed
Parameters
$paths : array<string|int, string>

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>

getAllClassNames()

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

public getAllClassNames() : array<string|int, string>
Tags
psalm-return

list

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
string

getPaths()

Retrieves the defined metadata lookup paths.

public getPaths() : array<int, string>
Return values
array<int, string>

getReader()

Retrieve the current annotation reader

public getReader() : AttributeReader
Tags
deprecated

no replacement planned.

Return values
AttributeReader

isTransient()

{@inheritDoc}

public isTransient(mixed $className) : mixed
Parameters
$className : mixed

loadMetadataForClass()

{@inheritDoc}

public loadMetadataForClass(mixed $className, ClassMetadata $metadata) : void
Parameters
$className : mixed
$metadata : ClassMetadata
Tags
psalm-param

class-string<T> $className

psalm-param

ClassMetadata<T> $metadata

template

T of object

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
psalm-return

array{ fieldName: string, type: mixed, scale: int, length: int, unique: bool, nullable: bool, precision: int, enumType?: class-string, options?: mixed[], columnName?: string, columnDefinition?: string }

Return values
array<string|int, mixed>

getFetchMode()

Attempts to resolve the fetch mode.

private getFetchMode(class-string $className, string $fetchMode) : ClassMetadata::FETCH_*
Parameters
$className : class-string

The class name.

$fetchMode : string

The fetch mode.

Tags
throws
MappingException

If the fetch mode is not valid.

Return values
ClassMetadata::FETCH_*

The fetch mode as defined in ClassMetadata.

getGeneratedMode()

Attempts to resolve the generated mode.

private getGeneratedMode(string $generatedMode) : int
Parameters
$generatedMode : string
Tags
throws
MappingException

If the fetch mode is not valid.

Return values
int

getMethodCallbacks()

Parses the given method.

private getMethodCallbacks(ReflectionMethod $method) : array<int, array{: string, : string}>
Parameters
$method : ReflectionMethod
Tags
psalm-return

list<array{string, (Events::*)}>

Return values
array<int, array{: string, : string}>

joinColumnToArray()

Parse the given JoinColumn as array

private joinColumnToArray(JoinColumn|InverseJoinColumn $joinColumn) : array<string|int, mixed>
Parameters
$joinColumn : JoinColumn|InverseJoinColumn
Tags
psalm-return

array{ name: string|null, unique: bool, nullable: bool, onDelete: mixed, columnDefinition: string|null, referencedColumnName: string, options?: array<string, mixed> }

Return values
array<string|int, mixed>

        
On this page

Search results