Doctrine


Doctrine\ORM\Mapping\OneToManyMapping
/Doctrine/ORM/Mapping/OneToManyMapping.php at line 47

Class OneToManyMapping

Class:OneToManyMapping - Superclass: AssociationMapping
AssociationMapping
⌊ OneToManyMapping

public class OneToManyMapping
extends AssociationMapping

Represents a one-to-many mapping.

NOTE: One-to-many mappings can currently not be uni-directional (one -> many). They must either be bidirectional (one <-> many) or unidirectional (many -> one). In other words, the many-side MUST be the owning side and the one-side MUST be the inverse side.

IMPORTANT NOTE:

The fields of this class are only public for 2 reasons: 1) To allow fast 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).

Instances of this class are stored serialized in the metadata cache together with the owning ClassMetadata instance.

Author:
Roman Borschel
Giorgio Sironi
Since:
2.0

Field Summary
mixed

$orderBy

READ-ONLY: Order this collection by the given SQL snippet.

boolean

$orphanRemoval

READ-ONLY: Whether to delete orphaned elements (removed from the collection)

Fields inherited from Doctrine\ORM\Mapping\AssociationMapping
FETCH_EAGER, FETCH_LAZY, declared, fetchMode, inherited, inversedBy, isCascadeDetach, isCascadeMerge, isCascadePersist, isCascadeRefresh, isCascadeRemove, isOwningSide, joinTable, mappedBy, sourceEntityName, sourceFieldName, targetEntityName
Method Summary
boolean

isOneToMany()

{@inheritdoc}

void

load(object sourceEntity, mixed targetCollection, EntityManager em, array joinColumnValues, $em The, $joinColumnValues , object target)

Loads a one-to-many collection.

boolean

shouldDeleteOrphans()

Whether orphaned elements (removed from the collection) should be deleted.

Methods inherited from Doctrine\ORM\Mapping\AssociationMapping
getQuotedJoinTableName, hasCascades, isEagerlyFetched, isLazilyFetched, isManyToMany, isOneToMany, isOneToOne, load, usesJoinTable

Field Detail

/Doctrine/ORM/Mapping/OneToManyMapping.php at line 62

orderBy

public mixed $orderBy

READ-ONLY: Order this collection by the given SQL snippet.


/Doctrine/ORM/Mapping/OneToManyMapping.php at line 54

orphanRemoval

public boolean $orphanRemoval = false

READ-ONLY: Whether to delete orphaned elements (removed from the collection)


Method Detail

/Doctrine/ORM/Mapping/OneToManyMapping.php at line 107

isOneToMany

public boolean isOneToMany()

Override.

/Doctrine/ORM/Mapping/OneToManyMapping.php at line 121

load

public void load(object sourceEntity, mixed targetCollection, EntityManager em, array joinColumnValues, $em The, $joinColumnValues , object target)

Loads a one-to-many collection.

Parameters:
The - entity that owns the collection.
The - collection to load/fill.
The - EntityManager to use.

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

shouldDeleteOrphans

public boolean shouldDeleteOrphans()

Whether orphaned elements (removed from the collection) should be deleted.

Returns:
TRUE if orphaned elements should be deleted, FALSE otherwise.

Doctrine