PHP Класс Neos\Flow\Persistence\Doctrine\Mapping\Driver\FlowAnnotationDriver

It gives precedence to Doctrine annotations but fills gaps from other info if possible: - Entity.repositoryClass is set to the repository found in the class schema - Table.name is set to a sane value - Column.type is set to property type - *.targetEntity is set to property type If a property is not marked as an association the mapping type is set to "object" for objects.
Наследование: implements Doctrine\Common\Persistence\Mapping\Driver\MappingDriver, implements Neos\Flow\Aop\Pointcut\PointcutFilterInterface
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$classNames array
$entityManager Doctrine\Common\Persistence\ObjectManager
$reader Doctrine\Common\Annotations\AnnotationReader
$reflectionService Neos\Flow\Reflection\ReflectionService
$tableNameLengthLimit integer

Открытые методы

Метод Описание
__construct ( ) Initializes a new AnnotationDriver that uses the given AnnotationReader for reading docblock annotations.
getAllClassNames ( ) : array Returns the names of all mapped (non-transient) classes known to this driver.
getRuntimeEvaluationsDefinition ( ) : array Returns runtime evaluations for a previously matched pointcut
hasRuntimeEvaluationsDefinition ( ) : boolean Returns TRUE if this filter holds runtime evaluations for a previously matched pointcut
inferTableNameFromClassName ( string $className, integer $lengthLimit = null ) : string Given a class name a table name is returned. That name should be reasonably unique.
injectReflectionService ( ReflectionService $reflectionService ) : void
isTransient ( string $className ) : boolean 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.
loadMetadataForClass ( string $className, Doctrine\Common\Persistence\Mapping\ClassMetadata $metadata ) : void Loads the metadata for the specified class into the provided container.
matches ( string $className, string $methodName, string $methodDeclaringClassName, mixed $pointcutQueryIdentifier ) : boolean Checks if the specified class has a property annotated with Id
reduceTargetClassNames ( ClassNameIndex $classNameIndex ) : ClassNameIndex This method is used to optimize the matching process.
setEntityManager ( Doctrine\Common\Persistence\ObjectManager $entityManager ) : void

Защищенные методы

Метод Описание
addColumnToMappingArray ( Doctrine\ORM\Mapping\Column $columnAnnotation, array $mapping = [], string $fieldName = null ) : array Parse the given Column into an array
buildJoinColumnsIfNeeded ( array $joinColumns, array $mapping, ReflectionProperty $property, integer $direction = self::MAPPING_REGULAR ) : array Check if the referenced column name is set (and valid) and if not make sure it is initialized properly.
buildJoinTableColumnName ( string $className ) : string Build a name for a column in a jointable.
evaluateEntityListenersAnnotation ( ReflectionClass $class, Doctrine\ORM\Mapping\ClassMetadata $metadata, array $classAnnotations ) : void Evaluate the EntityListeners annotation and amend the metadata accordingly.
evaluateJoinColumnAnnotations ( ReflectionProperty $property ) : array Check for and build JoinColummn/JoinColumns annotations.
evaluateJoinTableAnnotation ( Doctrine\ORM\Mapping\JoinTable $joinTableAnnotation, ReflectionProperty $property, string $className, array $mapping ) : array Evaluate JoinTable annotations and fill missing bits as needed.
evaluateLifeCycleAnnotations ( ReflectionClass $class, Doctrine\ORM\Mapping\ClassMetadataInfo $metadata ) : void Evaluate the lifecycle annotations and amend the metadata accordingly.
evaluateOverridesAnnotations ( array $classAnnotations, Doctrine\ORM\Mapping\ClassMetadataInfo $metadata ) : void Evaluate the association overrides annotations and amend the metadata accordingly.
evaluatePropertyAnnotations ( Doctrine\ORM\Mapping\ClassMetadataInfo $metadata ) : void Evaluate the property annotations and amend the metadata accordingly.
getClassSchema ( string $className ) : ClassSchema Fetch a class schema for the given class, if possible.
getMaxIdentifierLength ( ) : integer Derive maximum identifier length from doctrine DBAL
getMethodCallbacks ( ReflectionMethod $method ) : array Returns an array of callbacks for lifecycle annotations on the given method.
getUnproxiedClassName ( string $className ) : string Returns the classname after stripping a potentially present Compiler::ORIGINAL_CLASSNAME_SUFFIX.
inferJoinTableNameFromClassAndPropertyName ( string $className, string $propertyName ) : string Given a class and property name a table name is returned. That name should be reasonably unique.
isAggregateRoot ( string $className, string $propertySourceHint ) : boolean Check for $className being an aggregate root.
isValueObject ( string $className, string $propertySourceHint ) : boolean Check for $className being a value object.
joinColumnToArray ( Doctrine\ORM\Mapping\JoinColumn $joinColumnAnnotation, string $propertyName = null ) : array Parse the given JoinColumn into an array
truncateIdentifier ( string $identifier, integer $lengthLimit = null, string $hashSource = null ) : string Truncate an identifier if needed and append a hash to ensure uniqueness.

Приватные методы

Метод Описание
getFetchMode ( string $className, string $fetchMode ) : integer Attempts to resolve the fetch mode.

Описание методов

__construct() публичный Метод

Initializes a new AnnotationDriver that uses the given AnnotationReader for reading docblock annotations.
public __construct ( )

addColumnToMappingArray() защищенный Метод

Parse the given Column into an array
protected addColumnToMappingArray ( Doctrine\ORM\Mapping\Column $columnAnnotation, array $mapping = [], string $fieldName = null ) : array
$columnAnnotation Doctrine\ORM\Mapping\Column
$mapping array
$fieldName string
Результат array

buildJoinColumnsIfNeeded() защищенный Метод

Check if the referenced column name is set (and valid) and if not make sure it is initialized properly.
protected buildJoinColumnsIfNeeded ( array $joinColumns, array $mapping, ReflectionProperty $property, integer $direction = self::MAPPING_REGULAR ) : array
$joinColumns array
$mapping array
$property ReflectionProperty
$direction integer regular or inverse mapping (use is to be coded)
Результат array

buildJoinTableColumnName() защищенный Метод

Build a name for a column in a jointable.
protected buildJoinTableColumnName ( string $className ) : string
$className string
Результат string

evaluateEntityListenersAnnotation() защищенный Метод

Evaluate the EntityListeners annotation and amend the metadata accordingly.
protected evaluateEntityListenersAnnotation ( ReflectionClass $class, Doctrine\ORM\Mapping\ClassMetadata $metadata, array $classAnnotations ) : void
$class ReflectionClass
$metadata Doctrine\ORM\Mapping\ClassMetadata
$classAnnotations array
Результат void

evaluateJoinColumnAnnotations() защищенный Метод

If no annotations are found, a default is returned.
protected evaluateJoinColumnAnnotations ( ReflectionProperty $property ) : array
$property ReflectionProperty
Результат array

evaluateJoinTableAnnotation() защищенный Метод

Evaluate JoinTable annotations and fill missing bits as needed.
protected evaluateJoinTableAnnotation ( Doctrine\ORM\Mapping\JoinTable $joinTableAnnotation, ReflectionProperty $property, string $className, array $mapping ) : array
$joinTableAnnotation Doctrine\ORM\Mapping\JoinTable
$property ReflectionProperty
$className string
$mapping array
Результат array

evaluateLifeCycleAnnotations() защищенный Метод

Evaluate the lifecycle annotations and amend the metadata accordingly.
protected evaluateLifeCycleAnnotations ( ReflectionClass $class, Doctrine\ORM\Mapping\ClassMetadataInfo $metadata ) : void
$class ReflectionClass
$metadata Doctrine\ORM\Mapping\ClassMetadataInfo
Результат void

evaluateOverridesAnnotations() защищенный Метод

Evaluate the association overrides annotations and amend the metadata accordingly.
protected evaluateOverridesAnnotations ( array $classAnnotations, Doctrine\ORM\Mapping\ClassMetadataInfo $metadata ) : void
$classAnnotations array
$metadata Doctrine\ORM\Mapping\ClassMetadataInfo
Результат void

evaluatePropertyAnnotations() защищенный Метод

Evaluate the property annotations and amend the metadata accordingly.
protected evaluatePropertyAnnotations ( Doctrine\ORM\Mapping\ClassMetadataInfo $metadata ) : void
$metadata Doctrine\ORM\Mapping\ClassMetadataInfo
Результат void

getAllClassNames() публичный Метод

Returns the names of all mapped (non-transient) classes known to this driver.
public getAllClassNames ( ) : array
Результат array

getClassSchema() защищенный Метод

Fetch a class schema for the given class, if possible.
protected getClassSchema ( string $className ) : ClassSchema
$className string
Результат Neos\Flow\Reflection\ClassSchema

getMaxIdentifierLength() защищенный Метод

Derive maximum identifier length from doctrine DBAL
protected getMaxIdentifierLength ( ) : integer
Результат integer

getMethodCallbacks() защищенный Метод

Returns an array of callbacks for lifecycle annotations on the given method.
protected getMethodCallbacks ( ReflectionMethod $method ) : array
$method ReflectionMethod
Результат array

getRuntimeEvaluationsDefinition() публичный Метод

Returns runtime evaluations for a previously matched pointcut
public getRuntimeEvaluationsDefinition ( ) : array
Результат array Runtime evaluations

getUnproxiedClassName() защищенный Метод

Returns the classname after stripping a potentially present Compiler::ORIGINAL_CLASSNAME_SUFFIX.
protected getUnproxiedClassName ( string $className ) : string
$className string
Результат string

hasRuntimeEvaluationsDefinition() публичный Метод

Returns TRUE if this filter holds runtime evaluations for a previously matched pointcut
public hasRuntimeEvaluationsDefinition ( ) : boolean
Результат boolean TRUE if this filter has runtime evaluations

inferJoinTableNameFromClassAndPropertyName() защищенный Метод

Given a class and property name a table name is returned. That name should be reasonably unique.
protected inferJoinTableNameFromClassAndPropertyName ( string $className, string $propertyName ) : string
$className string Model class name the table corresponds to
$propertyName string Name of the property to be joined
Результат string Truncated database table name

inferTableNameFromClassName() публичный Метод

Given a class name a table name is returned. That name should be reasonably unique.
public inferTableNameFromClassName ( string $className, integer $lengthLimit = null ) : string
$className string
$lengthLimit integer
Результат string

injectReflectionService() публичный Метод

public injectReflectionService ( ReflectionService $reflectionService ) : void
$reflectionService Neos\Flow\Reflection\ReflectionService
Результат void

isAggregateRoot() защищенный Метод

Check for $className being an aggregate root.
protected isAggregateRoot ( string $className, string $propertySourceHint ) : boolean
$className string
$propertySourceHint string
Результат boolean

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 ) : boolean
$className string
Результат boolean

isValueObject() защищенный Метод

Check for $className being a value object.
protected isValueObject ( string $className, string $propertySourceHint ) : boolean
$className string
$propertySourceHint string
Результат boolean

joinColumnToArray() защищенный Метод

Parse the given JoinColumn into an array
protected joinColumnToArray ( Doctrine\ORM\Mapping\JoinColumn $joinColumnAnnotation, string $propertyName = null ) : array
$joinColumnAnnotation Doctrine\ORM\Mapping\JoinColumn
$propertyName string
Результат array

loadMetadataForClass() публичный Метод

Loads the metadata for the specified class into the provided container.
public loadMetadataForClass ( string $className, Doctrine\Common\Persistence\Mapping\ClassMetadata $metadata ) : void
$className string
$metadata Doctrine\Common\Persistence\Mapping\ClassMetadata
Результат void

matches() публичный Метод

Checks if the specified class has a property annotated with Id
public matches ( string $className, string $methodName, string $methodDeclaringClassName, mixed $pointcutQueryIdentifier ) : boolean
$className string Name of the class to check against
$methodName string Name of the method to check against
$methodDeclaringClassName string Name of the class the method was originally declared in
$pointcutQueryIdentifier mixed Some identifier for this query - must at least differ from a previous identifier. Used for circular reference detection.
Результат boolean TRUE if the class has *no* Id properties

reduceTargetClassNames() публичный Метод

This method is used to optimize the matching process.
public reduceTargetClassNames ( ClassNameIndex $classNameIndex ) : ClassNameIndex
$classNameIndex Neos\Flow\Aop\Builder\ClassNameIndex
Результат Neos\Flow\Aop\Builder\ClassNameIndex

setEntityManager() публичный Метод

public setEntityManager ( Doctrine\Common\Persistence\ObjectManager $entityManager ) : void
$entityManager Doctrine\Common\Persistence\ObjectManager
Результат void

truncateIdentifier() защищенный Метод

Truncate an identifier if needed and append a hash to ensure uniqueness.
protected truncateIdentifier ( string $identifier, integer $lengthLimit = null, string $hashSource = null ) : string
$identifier string
$lengthLimit integer
$hashSource string
Результат string

Описание свойств

$classNames защищенное свойство

protected array $classNames
Результат array

$entityManager защищенное свойство

protected ObjectManager,Doctrine\Common\Persistence $entityManager
Результат Doctrine\Common\Persistence\ObjectManager

$reader защищенное свойство

protected AnnotationReader,Doctrine\Common\Annotations $reader
Результат Doctrine\Common\Annotations\AnnotationReader

$reflectionService защищенное свойство

protected ReflectionService,Neos\Flow\Reflection $reflectionService
Результат Neos\Flow\Reflection\ReflectionService

$tableNameLengthLimit защищенное свойство

protected int $tableNameLengthLimit
Результат integer