interface ClassMetadata (View source)

Contract for a Doctrine persistence layer ClassMetadata class to implement.

Methods

string
getName()

Gets the fully-qualified class name of this persistent class.

array
getIdentifier()

Gets the mapped identifier field name.

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 $fieldName)

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
getIdentifierFieldNames()

Returns an array of identifier field names numerically indexed.

array
getAssociationNames()

Returns 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.

boolean
isAssociationInverseSide(string $assocName)

Checks if the association is the inverse side of a bidirectional association.

string
getAssociationMappedByTargetField(string $assocName)

Returns the target field of the owning side of the association.

array
getIdentifierValues(object $object)

Returns the identifier of this object as an array with field name as key.

Details

string getName()

Gets the fully-qualified class name of this persistent class.

Return Value

string

array getIdentifier()

Gets the mapped identifier field name.

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

Return Value

array

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 $fieldName)

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

Parameters

string $fieldName

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 getIdentifierFieldNames()

Returns an array of identifier field names numerically indexed.

Return Value

array

array getAssociationNames()

Returns 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

boolean isAssociationInverseSide(string $assocName)

Checks if the association is the inverse side of a bidirectional association.

Parameters

string $assocName

Return Value

boolean

string getAssociationMappedByTargetField(string $assocName)

Returns the target field of the owning side of the association.

Parameters

string $assocName

Return Value

string

array getIdentifierValues(object $object)

Returns the identifier of this object as an array with field name as key.

Has to return an empty array if no identifier isset.

Parameters

object $object

Return Value

array