class ClassMetadata implements ClassMetadata (View source)

Properties

protected $class
protected $refClass
protected $reflFields
protected $identifierPropertyName
protected $associations
protected $fields

Methods

__construct(string $className)

Instantiates a new Metadata for the given $className.

string
getName()

Get fully-qualified class name of this persistent class.

setIdentifier($property)

No description

array
getIdentifier()

Gets the mapped identifier field name.

string
getRidPropertyName()

PHP 5.3, no array dereferencing.

getReflectionClass()

Gets the ReflectionClass instance for this mapped class.

boolean
isIdentifier(string $fieldName)

Checks if the given field name is a mapped identifier for this class.

boolean
hasField(string $property)

Checks if the given field is a mapped property for this class.

boolean
hasAssociation(string $fieldName)

Checks if the given field is a mapped association for this class.

boolean
isSingleValuedAssociation(string $fieldName)

Checks if the given field is a mapped single valued association for this class.

boolean
isCollectionValuedAssociation(string $fieldName)

Checks if the given field is a mapped collection valued association for this class.

Array
getFieldNames()

A numerically indexed list of field names of this persistent class.

Array
getAssociationNames()

A numerically indexed list of association names of this persistent class.

string
getTypeOfField(string $fieldName)

Returns a type name of this field.

string
getAssociationTargetClass(string $assocName)

Returns the target class name of the given association.

getReflectionProperties()

No description

getReflectionFields()

No description

discoverReflectionFields()

No description

array
getIdentifierFieldNames()

No description

boolean
isAssociationInverseSide(string $assocName)

No description

string
getAssociationMappedByTargetField(string $assocName)

No description

array
getIdentifierValues(object $object)

No description

string
getAssociation(string $field)

Returns the association mapped for the given $field.

setAssociations(array $associations)

No description

setFields(array $fields)

No description

setDocumentValue(mixed $document, string $property, string $value)

Given a $property and its $value, sets that property on the given $document by using a closures if available, otherwise fall back to reflection.

Array
getAssociations()

Returns all the possible associations mapped in the introspected class.

getFieldByProperty($property)

Returns the reflection property associated with the $property.

getField(string $field)

Returns the reflection property associated with the $field.

Array
getFields()

Returns all the fields of the introspected class.

boolean
isValuedAssociation(string $field, array $associationTypes)

Checks whether the $field is mapped as an association.

Details

__construct(string $className)

Instantiates a new Metadata for the given $className.

Parameters

string $className

string getName()

Get fully-qualified class name of this persistent class.

Return Value

string

setIdentifier($property)

Parameters

$property

array getIdentifier()

Gets the mapped identifier field name.

The returned structure is an array of the identifier field names.

Return Value

array

string getRidPropertyName()

PHP 5.3, no array dereferencing.

.

Return Value

string

ReflectionClass getReflectionClass()

Gets the ReflectionClass instance for this mapped class.

Return Value

ReflectionClass

boolean isIdentifier(string $fieldName)

Checks if the given field name is a mapped identifier for this class.

Parameters

string $fieldName

Return Value

boolean

boolean hasField(string $property)

Checks if the given field is a mapped property for this class.

Parameters

string $property The name of the property to which the field is mapped

Return Value

boolean

boolean hasAssociation(string $fieldName)

Checks if the given field is a mapped association for this class.

Parameters

string $fieldName

Return Value

boolean

boolean isSingleValuedAssociation(string $fieldName)

Checks if the given field is a mapped single valued association for this class.

Parameters

string $fieldName

Return Value

boolean

boolean isCollectionValuedAssociation(string $fieldName)

Checks if the given field is a mapped collection valued association for this class.

Parameters

string $fieldName

Return Value

boolean

Array getFieldNames()

A numerically indexed list of field names of this persistent class.

This array includes identifier fields if present on this class.

Return Value

Array

Array getAssociationNames()

A numerically indexed list of association names of this persistent class.

This array includes identifier associations if present on this class.

Return Value

Array

string getTypeOfField(string $fieldName)

Returns a type name of this field.

This type names can be implementation specific but should at least include the php types: integer, string, boolean, float/double, datetime.

Parameters

string $fieldName

Return Value

string

string getAssociationTargetClass(string $assocName)

Returns the target class name of the given association.

Parameters

string $assocName

Return Value

string

getReflectionProperties()

getReflectionFields()

protected discoverReflectionFields()

array getIdentifierFieldNames()

Return Value

array

boolean isAssociationInverseSide(string $assocName)

Parameters

string $assocName

Return Value

boolean

string getAssociationMappedByTargetField(string $assocName)

Parameters

string $assocName

Return Value

string

array getIdentifierValues(object $object)

Parameters

object $object

Return Value

array

protected string getAssociation(string $field)

Returns the association mapped for the given $field.

Parameters

string $field

Return Value

string

setAssociations(array $associations)

Parameters

array $associations

setFields(array $fields)

Parameters

array $fields

setDocumentValue(mixed $document, string $property, string $value)

Given a $property and its $value, sets that property on the given $document by using a closures if available, otherwise fall back to reflection.

Parameters

mixed $document
string $property
string $value

protected Array getAssociations()

Returns all the possible associations mapped in the introspected class.

Return Value

Array

protected Property getFieldByProperty($property)

Returns the reflection property associated with the $property.

Parameters

$property

Return Value

Property

protected Property getField(string $field)

Returns the reflection property associated with the $field.

Parameters

string $field

Return Value

Property

protected Array getFields()

Returns all the fields of the introspected class.

Return Value

Array

protected boolean isValuedAssociation(string $field, array $associationTypes)

Checks whether the $field is mapped as an association.

Parameters

string $field
array $associationTypes

Return Value

boolean