PHP Class Doctrine\ODM\MongoDB\PersistentCollection

Since: 1.0
Author: Jonathan H. Wage ([email protected])
Author: Roman Borschel ([email protected])
Inheritance: implements Doctrine\Common\Collections\Collection
Exibir arquivo Open project: pmjones/php-framework-benchmarks Class Usage Examples

Public Methods

Method Description
__construct ( Doctrine\Common\Collections\Collection $coll, DocumentManager $dm, Configuration $c )
__sleep ( ) Called by PHP when this collection is serialized. Ensures that only the elements are properly serialized.
add ( $value )
clear ( )
clearSnapshot ( ) INTERNAL: Clears the internal snapshot information and sets isDirty to true if the collection has elements.
contains ( $element )
containsKey ( $key )
count ( )
current ( ) Gets the element of the collection at the current iterator position.
exists ( Closure $p )
filter ( Closure $p )
first ( )
forAll ( Closure $p )
get ( $key )
getDeleteDiff ( ) : array INTERNAL: getDeleteDiff
getInsertDiff ( ) : array INTERNAL: getInsertDiff
getIterator ( )
getKeys ( )
getMapping ( )
getOwner ( ) : object INTERNAL: Gets the collection owner.
getReferences ( )
getSnapshot ( ) : array INTERNAL: Returns the last snapshot of the elements in the collection.
getTypeClass ( )
getValues ( )
indexOf ( $element )
initialize ( ) Initializes the collection by loading its contents from the database if the collection is not yet initialized.
isDirty ( ) : boolean Gets a boolean flag indicating whether this collection is dirty which means its state needs to be synchronized with the database.
isEmpty ( )
isInitialized ( ) : boolean Checks whether this collection has been initialized.
key ( )
last ( )
map ( Closure $func )
next ( ) Moves the internal iterator position to the next element.
offsetExists ( $offset )
offsetGet ( $offset )
offsetSet ( $offset, $value )
offsetUnset ( $offset )
partition ( Closure $p )
remove ( $key )
removeElement ( $element )
set ( $key, $value )
setDirty ( boolean $dirty ) Sets a boolean flag, indicating whether this collection is dirty.
setInitialized ( boolean $bool ) Sets the initialized flag of the collection, forcing it into that state.
setOwner ( object $document, array $mapping ) INTERNAL: Sets the collection's owning entity together with the AssociationMapping that describes the association between the owner and the elements of the collection.
setReferences ( array $references ) Set the array of mongo database references to be used to initialize this collection.
slice ( $offset, $length = null )
takeSnapshot ( ) INTERNAL: Tells this collection to take a snapshot of its current state.
toArray ( )
unwrap ( ) Retrieves the wrapped Collection instance.

Private Methods

Method Description
changed ( ) Marks this collection as changed/dirty.

Method Details

__construct() public method

public __construct ( Doctrine\Common\Collections\Collection $coll, DocumentManager $dm, Configuration $c )
$coll Doctrine\Common\Collections\Collection
$dm DocumentManager
$c Configuration

__sleep() public method

Called by PHP when this collection is serialized. Ensures that only the elements are properly serialized.
public __sleep ( )

add() public method

public add ( $value )

clear() public method

public clear ( )

clearSnapshot() public method

INTERNAL: Clears the internal snapshot information and sets isDirty to true if the collection has elements.
public clearSnapshot ( )

contains() public method

public contains ( $element )

containsKey() public method

public containsKey ( $key )

count() public method

public count ( )

current() public method

Gets the element of the collection at the current iterator position.
public current ( )

exists() public method

public exists ( Closure $p )
$p Closure

filter() public method

public filter ( Closure $p )
$p Closure

first() public method

public first ( )

forAll() public method

public forAll ( Closure $p )
$p Closure

get() public method

public get ( $key )

getDeleteDiff() public method

INTERNAL: getDeleteDiff
public getDeleteDiff ( ) : array
return array

getInsertDiff() public method

INTERNAL: getInsertDiff
public getInsertDiff ( ) : array
return array

getIterator() public method

public getIterator ( )

getKeys() public method

public getKeys ( )

getMapping() public method

public getMapping ( )

getOwner() public method

INTERNAL: Gets the collection owner.
public getOwner ( ) : object
return object

getReferences() public method

public getReferences ( )

getSnapshot() public method

INTERNAL: Returns the last snapshot of the elements in the collection.
public getSnapshot ( ) : array
return array The last snapshot of the elements.

getTypeClass() public method

public getTypeClass ( )

getValues() public method

public getValues ( )

indexOf() public method

public indexOf ( $element )

initialize() public method

Initializes the collection by loading its contents from the database if the collection is not yet initialized.
public initialize ( )

isDirty() public method

Gets a boolean flag indicating whether this collection is dirty which means its state needs to be synchronized with the database.
public isDirty ( ) : boolean
return boolean TRUE if the collection is dirty, FALSE otherwise.

isEmpty() public method

public isEmpty ( )

isInitialized() public method

Checks whether this collection has been initialized.
public isInitialized ( ) : boolean
return boolean

key() public method

public key ( )

last() public method

public last ( )

map() public method

public map ( Closure $func )
$func Closure

next() public method

Moves the internal iterator position to the next element.
public next ( )

offsetExists() public method

See also: containsKey()
public offsetExists ( $offset )

offsetGet() public method

See also: get()
public offsetGet ( $offset )

offsetSet() public method

See also: add()
See also: set()
public offsetSet ( $offset, $value )

offsetUnset() public method

See also: remove()
public offsetUnset ( $offset )

partition() public method

public partition ( Closure $p )
$p Closure

remove() public method

public remove ( $key )

removeElement() public method

public removeElement ( $element )

set() public method

public set ( $key, $value )

setDirty() public method

Sets a boolean flag, indicating whether this collection is dirty.
public setDirty ( boolean $dirty )
$dirty boolean Whether the collection should be marked dirty or not.

setInitialized() public method

Sets the initialized flag of the collection, forcing it into that state.
public setInitialized ( boolean $bool )
$bool boolean

setOwner() public method

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 setOwner ( object $document, array $mapping )
$document object
$mapping array

setReferences() public method

Set the array of mongo database references to be used to initialize this collection.
public setReferences ( array $references )
$references array

slice() public method

public slice ( $offset, $length = null )

takeSnapshot() public method

INTERNAL: Tells this collection to take a snapshot of its current state.
public takeSnapshot ( )

toArray() public method

public toArray ( )

unwrap() public method

Retrieves the wrapped Collection instance.
public unwrap ( )