Documentation

ClassMetadata

Contract for a Doctrine persistence layer ClassMetadata class to implement.

Tags
template-covariant

T of object

Table of Contents

Methods

getAssociationMappedByTargetField()  : string
Returns the target field of the owning side of the association.
getAssociationNames()  : array<int, string>
Returns a numerically indexed list of association names of this persistent class.
getAssociationTargetClass()  : string|null
Returns the target class name of the given association.
getFieldNames()  : array<int, string>
A numerically indexed list of field names of this persistent class.
getIdentifier()  : array<int, string>
Gets the mapped identifier field name.
getIdentifierFieldNames()  : array<int, string>
Returns an array of identifier field names numerically indexed.
getIdentifierValues()  : array<string, mixed>
Returns the identifier of this object as an array with field name as key.
getName()  : string
Gets the fully-qualified class name of this persistent class.
getReflectionClass()  : ReflectionClass<string|int, T>
Gets the ReflectionClass instance for this mapped class.
getTypeOfField()  : string|null
Returns a type name of this field.
hasAssociation()  : bool
Checks if the given field is a mapped association for this class.
hasField()  : bool
Checks if the given field is a mapped property for this class.
isAssociationInverseSide()  : bool
Checks if the association is the inverse side of a bidirectional association.
isCollectionValuedAssociation()  : bool
Checks if the given field is a mapped collection valued association for this class.
isIdentifier()  : bool
Checks if the given field name is a mapped identifier for this class.
isSingleValuedAssociation()  : bool
Checks if the given field is a mapped single valued association for this class.

Methods

getAssociationMappedByTargetField()

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

public getAssociationMappedByTargetField(string $assocName) : string
Parameters
$assocName : string
Return values
string

getAssociationNames()

Returns a numerically indexed list of association names of this persistent class.

public getAssociationNames() : array<int, string>

This array includes identifier associations if present on this class.

Return values
array<int, string>

getAssociationTargetClass()

Returns the target class name of the given association.

public getAssociationTargetClass(string $assocName) : string|null
Parameters
$assocName : string
Tags
psalm-return

class-string|null

Return values
string|null

getFieldNames()

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

public getFieldNames() : array<int, string>

This array includes identifier fields if present on this class.

Return values
array<int, string>

getIdentifier()

Gets the mapped identifier field name.

public getIdentifier() : array<int, string>

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

Tags
psalm-return

list

Return values
array<int, string>

getIdentifierFieldNames()

Returns an array of identifier field names numerically indexed.

public getIdentifierFieldNames() : array<int, string>
Return values
array<int, string>

getIdentifierValues()

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

public getIdentifierValues(object $object) : array<string, mixed>

Has to return an empty array if no identifier isset.

Parameters
$object : object
Return values
array<string, mixed>

getName()

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

public getName() : string
Tags
psalm-return

class-string<T>

Return values
string

getReflectionClass()

Gets the ReflectionClass instance for this mapped class.

public getReflectionClass() : ReflectionClass<string|int, T>
Return values
ReflectionClass<string|int, T>

getTypeOfField()

Returns a type name of this field.

public getTypeOfField(string $fieldName) : string|null

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

Parameters
$fieldName : string
Return values
string|null

hasAssociation()

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

public hasAssociation(string $fieldName) : bool
Parameters
$fieldName : string
Return values
bool

hasField()

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

public hasField(string $fieldName) : bool
Parameters
$fieldName : string
Return values
bool

isAssociationInverseSide()

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

public isAssociationInverseSide(string $assocName) : bool
Parameters
$assocName : string
Return values
bool

isCollectionValuedAssociation()

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

public isCollectionValuedAssociation(string $fieldName) : bool
Parameters
$fieldName : string
Return values
bool

isIdentifier()

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

public isIdentifier(string $fieldName) : bool
Parameters
$fieldName : string
Return values
bool

isSingleValuedAssociation()

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

public isSingleValuedAssociation(string $fieldName) : bool
Parameters
$fieldName : string
Return values
bool

        
On this page

Search results