Doctrine


Doctrine\ORM\Mapping\AssociationMapping
/Doctrine/ORM/Mapping/AssociationMapping.php at line 36

Class AssociationMapping

AssociationMapping

public abstract class AssociationMapping

Base class for association mappings.

IMPORTANT NOTE:

The fields of this class are only public for 2 reasons: 1) To allow fast, internal READ access. 2) To drastically reduce the size of a serialized instance (private/protected members get the whole class name, namespace inclusive, prepended to every property in the serialized representation).

Author:
Roman Borschel
Since:
2.0

Field Summary
final integer

FETCH_EAGER

Specifies that an association is to be fetched when the owner of the association is fetched.

final integer

FETCH_LAZY

Specifies that an association is to be fetched when it is first accessed.

string

$declared

READ-ONLY: The name of the entity or mapped superclass that declares the association field in an inheritance hierarchy.

integer

$fetchMode

READ-ONLY: The fetch mode used for the association.

string

$inherited

READ-ONLY: The name of the entity class from which the association was inherited in an inheritance hierarchy.

string

$inversedBy

READ-ONLY: Identifies the field on the inverse side of a bidirectional association.

boolean

$isCascadeDetach

READ-ONLY: Whether the association cascades detach() operations from the source entity to the target entity/entities.

boolean

$isCascadeMerge

READ-ONLY: Whether the association cascades merge() operations from the source entity to the target entity/entities.

boolean

$isCascadePersist

READ-ONLY: Whether the association cascades save() operations from the source entity to the target entity/entities.

boolean

$isCascadeRefresh

READ-ONLY: Whether the association cascades refresh() operations from the source entity to the target entity/entities.

boolean

$isCascadeRemove

READ-ONLY: Whether the association cascades delete() operations from the source entity to the target entity/entities.

boolean

$isOwningSide

READ-ONLY: Flag that indicates whether the class that defines this mapping is the owning side of the association.

array

$joinTable

READ-ONLY: The join table definition, if any.

string

$mappedBy

READ-ONLY: Identifies the field on the owning side of a bidirectional association that controls the mapping for the association.

string

$sourceEntityName

READ-ONLY: The name of the source Entity (the Entity that defines this mapping).

string

$sourceFieldName

READ-ONLY: Identifies the field on the source class (the class this AssociationMapping belongs to) that represents the association and stores the reference to the other entity/entities.

string

$targetEntityName

READ-ONLY: The name of the target Entity (the Enitity that is the target of the association).

Constructor Summary

AssociationMapping(array mapping)

Initializes a new instance of a class derived from AssociationMapping.

Method Summary
string

getQuotedJoinTableName(AbstractPlatform platform)

Gets the (possibly quoted) name of the join table.

boolean

hasCascades()

Checks whether the association has any cascades configured.

boolean

isEagerlyFetched()

Whether the target entity/entities of the association are eagerly fetched.

boolean

isLazilyFetched()

Whether the target entity/entities of the association are lazily fetched.

boolean

isManyToMany()

Whether the association is a many-to-many association.

boolean

isOneToMany()

Whether the association is a one-to-many association.

boolean

isOneToOne()

Whether the association is a one-to-one association.

abstract void

load(object sourceEntity, object target, EntityManager em, array joinColumnValues)

Loads data in $target domain object using this association.

boolean

usesJoinTable()

Whether the association uses a join table for the mapping.

Field Detail

/Doctrine/ORM/Mapping/AssociationMapping.php at line 50

FETCH_EAGER

public final integer FETCH_EAGER = 3

Specifies that an association is to be fetched when the owner of the association is fetched.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 43

FETCH_LAZY

public final integer FETCH_LAZY = 2

Specifies that an association is to be fetched when it is first accessed.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 169

declared

public string $declared

READ-ONLY: The name of the entity or mapped superclass that declares the association field in an inheritance hierarchy.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 97

fetchMode

public integer $fetchMode

READ-ONLY: The fetch mode used for the association.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 161

inherited

public string $inherited

READ-ONLY: The name of the entity class from which the association was inherited in an inheritance hierarchy.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 146

inversedBy

public string $inversedBy

READ-ONLY: Identifies the field on the inverse side of a bidirectional association. This is only set on the owning side of an association.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 90

isCascadeDetach

public boolean $isCascadeDetach

READ-ONLY: Whether the association cascades detach() operations from the source entity to the target entity/entities.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 82

isCascadeMerge

public boolean $isCascadeMerge

READ-ONLY: Whether the association cascades merge() operations from the source entity to the target entity/entities.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 66

isCascadePersist

public boolean $isCascadePersist

READ-ONLY: Whether the association cascades save() operations from the source entity to the target entity/entities.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 74

isCascadeRefresh

public boolean $isCascadeRefresh

READ-ONLY: Whether the association cascades refresh() operations from the source entity to the target entity/entities.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 58

isCascadeRemove

public boolean $isCascadeRemove

READ-ONLY: Whether the association cascades delete() operations from the source entity to the target entity/entities.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 105

isOwningSide

public boolean $isOwningSide = true

READ-ONLY: Flag that indicates whether the class that defines this mapping is the owning side of the association.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 153

joinTable

public array $joinTable

READ-ONLY: The join table definition, if any.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 138

mappedBy

public string $mappedBy

READ-ONLY: Identifies the field on the owning side of a bidirectional association that controls the mapping for the association. This is only set on the inverse side of an association.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 112

sourceEntityName

public string $sourceEntityName

READ-ONLY: The name of the source Entity (the Entity that defines this mapping).


/Doctrine/ORM/Mapping/AssociationMapping.php at line 129

sourceFieldName

public string $sourceFieldName

READ-ONLY: Identifies the field on the source class (the class this AssociationMapping belongs to) that represents the association and stores the reference to the other entity/entities.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 120

targetEntityName

public string $targetEntityName

READ-ONLY: The name of the target Entity (the Enitity that is the target of the association).


Constructor Detail

/Doctrine/ORM/Mapping/AssociationMapping.php at line 176

AssociationMapping

public AssociationMapping(array mapping)

Initializes a new instance of a class derived from AssociationMapping.

Parameters:
mapping - The mapping definition.

Method Detail

/Doctrine/ORM/Mapping/AssociationMapping.php at line 337

getQuotedJoinTableName

public string getQuotedJoinTableName(AbstractPlatform platform)

Gets the (possibly quoted) name of the join table.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 309

hasCascades

public boolean hasCascades()

Checks whether the association has any cascades configured.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 249

isEagerlyFetched

public boolean isEagerlyFetched()

Whether the target entity/entities of the association are eagerly fetched.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 259

isLazilyFetched

public boolean isLazilyFetched()

Whether the target entity/entities of the association are lazily fetched.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 289

isManyToMany

public boolean isManyToMany()

Whether the association is a many-to-many association.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 279

isOneToMany

public boolean isOneToMany()

Whether the association is a one-to-many association.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 269

isOneToOne

public boolean isOneToOne()

Whether the association is a one-to-one association.


/Doctrine/ORM/Mapping/AssociationMapping.php at line 329

load

public abstract void load(object sourceEntity, object target, EntityManager em, array joinColumnValues)

Loads data in $target domain object using this association. The data comes from the association navigated from $sourceEntity using $em.

Parameters:
target - an entity or a collection
joinColumnValues - foreign keys (significative for this association) of $sourceEntity, if needed

/Doctrine/ORM/Mapping/AssociationMapping.php at line 299

usesJoinTable

public boolean usesJoinTable()

Whether the association uses a join table for the mapping.


Doctrine