class GenericClassMetadata extends ArrayObject implements ClassMetadata (View source)

Minimalistice ClassMetadata implementation

Traits

Id generator related method for ClassMetadata implementations.
Use ReflectionService to set identifier values in a ClassMetadata
Field and mapping

Properties

$idGenerator ID generator-compatible class from IdGeneratorTypeClassnameTrait
array $customGeneratorDefinition from IdGeneratorTypeClassnameTrait
array $lifecycleCallbacks from LifecycleCallbackClassMetadataTrait

Methods

setCustomGeneratorDefinition(array $definition)

No description

ReflectionService
getReflectionService()

No description

setReflection(ReflectionService $reflectionService)

No description

initializeReflection(ReflectionService $reflectionService)

No description

mixed[]
getIdentifierValues(object $object)

No description

setIdentifierValues(object $object, mixed[] $generatedValues)

No description

string[]
getFieldNames()

Get all field names.

boolean
hasField(string $fieldName)

Indicates if a field is part of the class.

array|mixed[]
getIdentifierFieldNames()

Get identifier fields.

array|mixed[]
getIdentifier()

Get identifier field names.

isIdentifier(string $fieldName)

Indicates if the given field is an identifier field.

string
getTypeOfField(string $fieldName)

Get the given field type name

mapField(array $mapping)

Implements ClassMetadata interface.

addInheritedFieldMapping(array $mapping)

No description

array
getFieldMapping(string $fieldName)

Get raw field mapping

array
getFieldMappings()

No description

defaultMapField(array $mapping)

Base implementation of a mapField function

string[]
getAssociationNames()

Get association names.

boolean
isSingleValuedAssociation(string $fieldName)

Indicates if assiciation targets a single value.

boolean
isCollectionValuedAssociation(string $fieldName)

Indicates is association targets multiple values.

boolean
isAssociationInverseSide(string $associationName)

Implements ClassMetadata interface.

mapManyToMany(array $mapping)

MDoctrine ORM compatibility.

mapManyToOne(array $mapping)

Doctrine ORM compatibility.

mapOneToMany(array $mapping)

Doctrine ORM compatibility.

mapOneToOne(array $mapping)

Doctrine ORM compatibility.

getAssociationMapping(string $fieldName)

No description

boolean
hasAssociation(string $fieldName)

Indicates if the given field has an association with another entity field.

mixed|string|array|Traversable
getAssociationTargetClass(string $associationName)

Get associated field class.

string
getAssociationMappedByTargetField(string $associationName)

Get association mapped target.

addInheritedAssociationMapping(array $mapping)

Set class field mapping

boolean
hasLifecycleCallbacks(string $event)

Indicates if object has a lifecycle callback for the given event name

addLifecycleCallback(string $event, string $method)

Set the object lifecycle callback for ghe given event.

__construct(string $className)

No description

__set(string $key, mixed $value)

Store key value to the ArrayObject

string|mixed
__get(string $key)

No description

offsetSet($index, $value)

No description

offsetGet($index)

No description

__call(string $method, array $arguments)

Silently do nothing

getName()

{@inheritdoc}

getReflectionClass()

{@inheritdoc}

Details

setIdGeneratorType(string|IdGeneratorInterface $type)

Parameters

string|IdGeneratorInterface $type ID generator type , class nmme or short name

Exceptions

InvalidArgumentException

setCustomGeneratorDefinition(array $definition)

Parameters

array $definition Custom ID generator descriptor

ReflectionService getReflectionService()

Return Value

ReflectionService

setReflection(ReflectionService $reflectionService)

Parameters

ReflectionService $reflectionService Reflection service

initializeReflection(ReflectionService $reflectionService)

Parameters

ReflectionService $reflectionService

mixed[] getIdentifierValues(object $object)

Parameters

object $object Object

Return Value

mixed[] Values of ID fields

setIdentifierValues(object $object, mixed[] $generatedValues)

Parameters

object $object Object
mixed[] $generatedValues ID field values

string[] getFieldNames()

Get all field names.

Implements ClassMetadata interface.

Return Value

string[]

boolean hasField(string $fieldName)

Indicates if a field is part of the class.

Implements ClassMetadata interface.

Parameters

string $fieldName Field name

Return Value

boolean

array|mixed[] getIdentifierFieldNames()

Get identifier fields.

Implements interface of ClassMetadata

Return Value

array|mixed[]

array|mixed[] getIdentifier()

Get identifier field names.

Implements ClassMetadata interface.

Return Value

array|mixed[]

isIdentifier(string $fieldName)

Indicates if the given field is an identifier field.

Implements ClassMetadata interface.

Parameters

string $fieldName Field name

string getTypeOfField(string $fieldName)

Get the given field type name

Implements ClassMetadata interface.

Parameters

string $fieldName Field name

Return Value

string Type name

mapField(array $mapping)

Implements ClassMetadata interface.

Parameters

array $mapping Field mapping data

addInheritedFieldMapping(array $mapping)

Parameters

array $mapping

array getFieldMapping(string $fieldName)

Get raw field mapping

Parameters

string $fieldName Field name

Return Value

array Field or association mapping

Exceptions

MappingException

array getFieldMappings()

Return Value

array Field mappings

protected defaultMapField(array $mapping)

Base implementation of a mapField function

Parameters

array $mapping Field mapping

protected defaultAddInheritedFieldMapping(array $mapping)

Parameters

array $mapping

string[] getAssociationNames()

Get association names.

Implements ClassMetadata interface.

Return Value

string[]

boolean isSingleValuedAssociation(string $fieldName)

Indicates if assiciation targets a single value.

Implements ClassMetadata interface.

Parameters

string $fieldName Association name

Return Value

boolean

boolean isCollectionValuedAssociation(string $fieldName)

Indicates is association targets multiple values.

Implements ClassMetadata interface.

Parameters

string $fieldName Association name

Return Value

boolean

boolean isAssociationInverseSide(string $associationName)

Implements ClassMetadata interface.

"inspired" by Doctrin ORM implementation.

Parameters

string $associationName Association name

Return Value

boolean

mapManyToMany(array $mapping)

MDoctrine ORM compatibility.

Parameters

array $mapping Association mapping

mapManyToOne(array $mapping)

Doctrine ORM compatibility.

Parameters

array $mapping Association mapping

mapOneToMany(array $mapping)

Doctrine ORM compatibility.

Parameters

array $mapping Association mapping

mapOneToOne(array $mapping)

Doctrine ORM compatibility.

Parameters

array $mapping Association mapping

getAssociationMapping(string $fieldName)

Parameters

string $fieldName Association name

Exceptions

MappingException

boolean hasAssociation(string $fieldName)

Indicates if the given field has an association with another entity field.

Implements ClassMetadata interface.

Parameters

string $fieldName Field name

Return Value

boolean

mixed|string|array|Traversable getAssociationTargetClass(string $associationName)

Get associated field class.

Implements ClassMetadata interface.

Parameters

string $associationName Association name

Return Value

mixed|string|array|Traversable

array getAssociationMappings()

Return Value

array

string getAssociationMappedByTargetField(string $associationName)

Get association mapped target.

Implements ClassMetadata interface.

Parameters

string $associationName Association name

Return Value

string

addInheritedAssociationMapping(array $mapping)

Set class field mapping

Parameters

array $mapping Field mapping

protected defaultMapAssociation($mapping)

Parameters

$mapping

protected defaultAddInheritedAssociationMapping(array $mapping)

Parameters

array $mapping

boolean hasLifecycleCallbacks(string $event)

Indicates if object has a lifecycle callback for the given event name

Parameters

string $event Event name

Return Value

boolean

addLifecycleCallback(string $event, string $method)

Set the object lifecycle callback for ghe given event.

Parameters

string $event Event name
string $method Method name

__construct(string $className)

Parameters

string $className Object class name

__set(string $key, mixed $value)

Store key value to the ArrayObject

Parameters

string $key Mapping information key
mixed $value Value

string|mixed __get(string $key)

Parameters

string $key Mapping information key

Return Value

string|mixed

offsetSet($index, $value)

Parameters

$index
$value

offsetGet($index)

Parameters

$index

__call(string $method, array $arguments)

Silently do nothing

Parameters

string $method Method name
array $arguments Method arguments

getName()

{@inheritdoc}

See also

\Doctrine\Persistence\Mapping\ClassMetadata::getName()

getReflectionClass()

{@inheritdoc}

See also

\Doctrine\Persistence\Mapping\ClassMetadata::getReflectionClass()