PersistentCollection
public final class PersistentCollection
Constructor Summary | |
---|---|
PersistentCollection(EntityManager em, ClassMetadata class, mixed coll, array The) Creates a new persistent collection. |
Method Summary | |
---|---|
void | add(mixed value) {@inheritdoc} |
void | clear() {@inheritdoc} |
void | contains(mixed element) {@inheritdoc} |
void | containsKey(mixed key) {@inheritdoc} |
void | count() {@inheritdoc} |
void | current() Gets the element of the collection at the current iterator position. |
void | exists(mixed p) {@inheritdoc} |
void | filter(mixed p) {@inheritdoc} |
void | first() {@inheritdoc} |
void | forAll(mixed p) {@inheritdoc} |
void | get(mixed key) {@inheritdoc} |
array | INTERNAL: getDeleteDiff |
array | INTERNAL: getInsertDiff |
void | {@inheritdoc} |
void | getKeys() {@inheritdoc} |
Doctrine\ORM\Mapping\AssociationMapping | INTERNAL: Gets the association mapping of the collection. |
object | getOwner() INTERNAL: Gets the collection owner. |
array | INTERNAL: Returns the last snapshot of the elements in the collection. |
void | |
void | {@inheritdoc} |
void | hydrateAdd(mixed element) INTERNAL: Adds an element to a collection during hydration. |
void | hydrateSet(mixed key, mixed element) INTERNAL: Sets a keyed element in the collection during hydration. |
void | indexOf(mixed element) {@inheritdoc} |
boolean | isDirty() Gets a boolean flag indicating whether this colleciton is dirty which means its state needs to be synchronized with the database. |
void | isEmpty() {@inheritdoc} |
boolean | Checks whether this collection has been initialized. |
void | key() |
void | last() {@inheritdoc} |
void | map(mixed func) {@inheritdoc} |
void | next() Moves the internal iterator position to the next element. |
void | offsetExists(mixed offset) |
void | offsetGet(mixed offset) |
void | offsetSet(mixed offset, mixed value) |
void | offsetUnset(mixed offset) |
void | partition(mixed p) {@inheritdoc} |
void | remove(mixed key) {@inheritdoc} |
void | removeElement(mixed element) {@inheritdoc} |
void | set(mixed key, mixed value) {@inheritdoc} |
void | setDirty(boolean dirty) Sets a boolean flag, indicating whether this collection is dirty. |
void | setInitialized(boolean bool) Sets the initialized flag of the collection, forcing it into that state. |
void | setOwner(object entity, AssociationMapping assoc) INTERNAL: Sets the collection's owning entity together with the AssociationMapping that describes the association between the owner and the elements of the collection. |
void | INTERNAL: Tells this collection to take a snapshot of its current state. |
void | toArray() {@inheritdoc} |
void | unwrap() Retrieves the wrapped Collection instance. |
public PersistentCollection(EntityManager em, ClassMetadata class, mixed coll, array The)
Creates a new persistent collection.
public void add(mixed value)
public void clear()
public void contains(mixed element)
public void containsKey(mixed key)
public void count()
public void current()
Gets the element of the collection at the current iterator position.
public void exists(mixed p)
public void filter(mixed p)
public void first()
public void forAll(mixed p)
public void get(mixed key)
public array getDeleteDiff()
INTERNAL: getDeleteDiff
public array getInsertDiff()
INTERNAL: getInsertDiff
public void getIterator()
public void getKeys()
public Doctrine\ORM\Mapping\AssociationMapping getMapping()
INTERNAL: Gets the association mapping of the collection.
public object getOwner()
INTERNAL: Gets the collection owner.
public array getSnapshot()
INTERNAL: Returns the last snapshot of the elements in the collection.
public void getTypeClass()
public void getValues()
public void hydrateAdd(mixed element)
INTERNAL: Adds an element to a collection during hydration. This will automatically complete bidirectional associations in the case of a one-to-many association.
public void hydrateSet(mixed key, mixed element)
INTERNAL: Sets a keyed element in the collection during hydration.
public void indexOf(mixed element)
public boolean isDirty()
Gets a boolean flag indicating whether this colleciton is dirty which means its state needs to be synchronized with the database.
public void isEmpty()
public boolean isInitialized()
Checks whether this collection has been initialized.
public void key()
public void last()
public void map(mixed func)
public void next()
Moves the internal iterator position to the next element.
public void offsetExists(mixed offset)
public void offsetGet(mixed offset)
public void offsetSet(mixed offset, mixed value)
public void offsetUnset(mixed offset)
public void partition(mixed p)
public void remove(mixed key)
public void removeElement(mixed element)
public void set(mixed key, mixed value)
public void setDirty(boolean dirty)
Sets a boolean flag, indicating whether this collection is dirty.
public void setInitialized(boolean bool)
Sets the initialized flag of the collection, forcing it into that state.
public void setOwner(object entity, AssociationMapping assoc)
INTERNAL: Sets the collection's owning entity together with the AssociationMapping that describes the association between the owner and the elements of the collection.
public void takeSnapshot()
INTERNAL: Tells this collection to take a snapshot of its current state.
public void toArray()
public void unwrap()
Retrieves the wrapped Collection instance.
A PersistentCollection represents a collection of elements that have persistent state.
Collections of entities represent only the associations (links) to those entities. That means, if the collection is part of a many-many mapping and you remove entities from the collection, only the links in the relation table are removed (on flush). Similarly, if you remove entities from a collection that is part of a one-many mapping this will only result in the nulling out of the foreign keys on flush.