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.

mixed[]
getIdentifier()

Gets the mapped identifier field name.

getReflectionClass()

Gets the ReflectionClass instance for this mapped class.

bool
isIdentifier(string $fieldName)

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

bool
hasField(string $fieldName)

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

bool
hasAssociation(string $fieldName)

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

bool
isSingleValuedAssociation(string $fieldName)

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

bool
isCollectionValuedAssociation(string $fieldName)

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

string[]
getFieldNames()

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

string[]
getIdentifierFieldNames()

Returns an array of identifier field names numerically indexed.

string[]
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.

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

mixed[]
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

mixed[] getIdentifier()

Gets the mapped identifier field name.

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

Return Value

mixed[]

ReflectionClass getReflectionClass()

Gets the ReflectionClass instance for this mapped class.

Return Value

ReflectionClass

bool isIdentifier(string $fieldName)

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

Parameters

string $fieldName

Return Value

bool

bool hasField(string $fieldName)

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

Parameters

string $fieldName

Return Value

bool

bool hasAssociation(string $fieldName)

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

Parameters

string $fieldName

Return Value

bool

bool isSingleValuedAssociation(string $fieldName)

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

Parameters

string $fieldName

Return Value

bool

bool isCollectionValuedAssociation(string $fieldName)

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

Parameters

string $fieldName

Return Value

bool

string[] getFieldNames()

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

This array includes identifier fields if present on this class.

Return Value

string[]

string[] getIdentifierFieldNames()

Returns an array of identifier field names numerically indexed.

Return Value

string[]

string[] 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

string[]

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

bool isAssociationInverseSide(string $assocName)

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

Parameters

string $assocName

Return Value

bool

string getAssociationMappedByTargetField(string $assocName)

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

Parameters

string $assocName

Return Value

string

mixed[] 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

mixed[]