Doctrine


Doctrine\ORM\PersistentCollection
/Doctrine/ORM/PersistentCollection.php at line 44

Class PersistentCollection

PersistentCollection
All Implemented Interfaces:
Collection

public final class PersistentCollection

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.

License:
http://www.opensource.org/licenses/lgpl-license.php LGPL
Since:
2.0
Version:
$Revision: 4930 $
Author:
Konsta Vesterinen
Roman Borschel
Giorgio Sironi

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

getDeleteDiff()

INTERNAL: getDeleteDiff

array

getInsertDiff()

INTERNAL: getInsertDiff

void

getIterator()

{@inheritdoc}

void

getKeys()

{@inheritdoc}

Doctrine\ORM\Mapping\AssociationMapping

getMapping()

INTERNAL: Gets the association mapping of the collection.

object

getOwner()

INTERNAL: Gets the collection owner.

array

getSnapshot()

INTERNAL: Returns the last snapshot of the elements in the collection.

void

getTypeClass()

void

getValues()

{@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

isInitialized()

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

takeSnapshot()

INTERNAL: Tells this collection to take a snapshot of its current state.

void

toArray()

{@inheritdoc}

void

unwrap()

Retrieves the wrapped Collection instance.

Constructor Detail

/Doctrine/ORM/PersistentCollection.php at line 118

PersistentCollection

public PersistentCollection(EntityManager em, ClassMetadata class, mixed coll, array The)

Creates a new persistent collection.

Parameters:
em - The EntityManager the collection will be associated with.
class - The class descriptor of the entity type of this collection.
The - collection elements.

Method Detail

/Doctrine/ORM/PersistentCollection.php at line 491

add

public void add(mixed value)


/Doctrine/ORM/PersistentCollection.php at line 564

clear

public void clear()


/Doctrine/ORM/PersistentCollection.php at line 401

contains

public void contains(mixed element)


/Doctrine/ORM/PersistentCollection.php at line 392

containsKey

public void containsKey(mixed key)


/Doctrine/ORM/PersistentCollection.php at line 472

count

public void count()


/Doctrine/ORM/PersistentCollection.php at line 634

current

public void current()

Gets the element of the collection at the current iterator position.


/Doctrine/ORM/PersistentCollection.php at line 427

exists

public void exists(mixed p)


/Doctrine/ORM/PersistentCollection.php at line 528

filter

public void filter(mixed p)


/Doctrine/ORM/PersistentCollection.php at line 333

first

public void first()


/Doctrine/ORM/PersistentCollection.php at line 537

forAll

public void forAll(mixed p)


/Doctrine/ORM/PersistentCollection.php at line 445

get

public void get(mixed key)


/Doctrine/ORM/PersistentCollection.php at line 250

getDeleteDiff

public array getDeleteDiff()

INTERNAL: getDeleteDiff


/Doctrine/ORM/PersistentCollection.php at line 262

getInsertDiff

public array getInsertDiff()

INTERNAL: getInsertDiff


/Doctrine/ORM/PersistentCollection.php at line 510

getIterator

public void getIterator()


/Doctrine/ORM/PersistentCollection.php at line 454

getKeys

public void getKeys()


/Doctrine/ORM/PersistentCollection.php at line 273

getMapping

public Doctrine\ORM\Mapping\AssociationMapping getMapping()

INTERNAL: Gets the association mapping of the collection.


/Doctrine/ORM/PersistentCollection.php at line 146

getOwner

public object getOwner()

INTERNAL: Gets the collection owner.


/Doctrine/ORM/PersistentCollection.php at line 239

getSnapshot

public array getSnapshot()

INTERNAL: Returns the last snapshot of the elements in the collection.

Returns:
The last snapshot of the elements.

/Doctrine/ORM/PersistentCollection.php at line 151

getTypeClass

public void getTypeClass()

/Doctrine/ORM/PersistentCollection.php at line 463

getValues

public void getValues()


/Doctrine/ORM/PersistentCollection.php at line 163

hydrateAdd

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.

Parameters:
element - The element to add.

/Doctrine/ORM/PersistentCollection.php at line 186

hydrateSet

public void hydrateSet(mixed key, mixed element)

INTERNAL: Sets a keyed element in the collection during hydration.

Parameters:
key - The key to set. $param mixed $value The element to set.

/Doctrine/ORM/PersistentCollection.php at line 436

indexOf

public void indexOf(mixed element)


/Doctrine/ORM/PersistentCollection.php at line 297

isDirty

public boolean isDirty()

Gets a boolean flag indicating whether this colleciton is dirty which means its state needs to be synchronized with the database.

Returns:
TRUE if the collection is dirty, FALSE otherwise.

/Doctrine/ORM/PersistentCollection.php at line 501

isEmpty

public void isEmpty()


/Doctrine/ORM/PersistentCollection.php at line 327

isInitialized

public boolean isInitialized()

Checks whether this collection has been initialized.


/Doctrine/ORM/PersistentCollection.php at line 626

key

public void key()

/Doctrine/ORM/PersistentCollection.php at line 340

last

public void last()


/Doctrine/ORM/PersistentCollection.php at line 519

map

public void map(mixed func)


/Doctrine/ORM/PersistentCollection.php at line 642

next

public void next()

Moves the internal iterator position to the next element.


/Doctrine/ORM/PersistentCollection.php at line 593

offsetExists

public void offsetExists(mixed offset)

See Also:
containsKey()

/Doctrine/ORM/PersistentCollection.php at line 601

offsetGet

public void offsetGet(mixed offset)

See Also:
get()

/Doctrine/ORM/PersistentCollection.php at line 610

offsetSet

public void offsetSet(mixed offset, mixed value)

See Also:
add()
set()

/Doctrine/ORM/PersistentCollection.php at line 621

offsetUnset

public void offsetUnset(mixed offset)

See Also:
remove()

/Doctrine/ORM/PersistentCollection.php at line 546

partition

public void partition(mixed p)


/Doctrine/ORM/PersistentCollection.php at line 349

remove

public void remove(mixed key)


/Doctrine/ORM/PersistentCollection.php at line 371

removeElement

public void removeElement(mixed element)


/Doctrine/ORM/PersistentCollection.php at line 481

set

public void set(mixed key, mixed value)


/Doctrine/ORM/PersistentCollection.php at line 307

setDirty

public void setDirty(boolean dirty)

Sets a boolean flag, indicating whether this collection is dirty.

Parameters:
dirty - Whether the collection should be marked dirty or not.

/Doctrine/ORM/PersistentCollection.php at line 317

setInitialized

public void setInitialized(boolean bool)

Sets the initialized flag of the collection, forcing it into that state.


/Doctrine/ORM/PersistentCollection.php at line 133

setOwner

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.


/Doctrine/ORM/PersistentCollection.php at line 227

takeSnapshot

public void takeSnapshot()

INTERNAL: Tells this collection to take a snapshot of its current state.


/Doctrine/ORM/PersistentCollection.php at line 555

toArray

public void toArray()


/Doctrine/ORM/PersistentCollection.php at line 650

unwrap

public void unwrap()

Retrieves the wrapped Collection instance.


Doctrine