abstract class AbstractCollectionPersister (View source)

Base class for all collection persisters.

Properties

protected EntityManager $em
protected Connection $conn
protected UnitOfWork $uow
protected AbstractPlatform $platform The database platform.
protected QuoteStrategy $quoteStrategy The quote strategy.

Methods

__construct(EntityManager $em)

Initializes a new instance of a class derived from AbstractCollectionPersister.

void
delete(PersistentCollection $coll)

Deletes the persistent state represented by the given collection.

string
getDeleteSQL(PersistentCollection $coll)

Gets the SQL statement for deleting the given collection.

array
getDeleteSQLParameters(PersistentCollection $coll)

Gets the SQL parameters for the corresponding SQL statement to delete the given collection.

void
update(PersistentCollection $coll)

Updates the given collection, synchronizing its state with the database by inserting, updating and deleting individual elements.

void
deleteRows(PersistentCollection $coll)

Deletes rows.

void
insertRows(PersistentCollection $coll)

Inserts rows.

integer
count(PersistentCollection $coll)

Counts the size of this persistent collection.

array
slice(PersistentCollection $coll, integer $offset, integer $length = null)

Slices elements.

boolean
contains(PersistentCollection $coll, object $element)

Checks for existence of an element.

boolean
containsKey(PersistentCollection $coll, mixed $key)

Checks for existence of a key.

mixed
removeElement(PersistentCollection $coll, object $element)

Removes an element.

void
removeKey(PersistentCollection $coll, mixed $key)

Removes an element by key.

mixed
get(PersistentCollection $coll, mixed $index)

Gets an element by key.

string
getDeleteRowSQL(PersistentCollection $coll)

Gets the SQL statement used for deleting a row from the collection.

array
getDeleteRowSQLParameters(PersistentCollection $coll, mixed $element)

Gets the SQL parameters for the corresponding SQL statement to delete the given element from the given collection.

string
getUpdateRowSQL(PersistentCollection $coll)

Gets the SQL statement used for updating a row in the collection.

string
getInsertRowSQL(PersistentCollection $coll)

Gets the SQL statement used for inserting a row in the collection.

array
getInsertRowSQLParameters(PersistentCollection $coll, mixed $element)

Gets the SQL parameters for the corresponding SQL statement to insert the given element of the given collection into the database.

Details

__construct(EntityManager $em)

Initializes a new instance of a class derived from AbstractCollectionPersister.

Parameters

EntityManager $em

void delete(PersistentCollection $coll)

Deletes the persistent state represented by the given collection.

Parameters

PersistentCollection $coll

Return Value

void

abstract protected string getDeleteSQL(PersistentCollection $coll)

Gets the SQL statement for deleting the given collection.

Parameters

PersistentCollection $coll

Return Value

string

abstract protected array getDeleteSQLParameters(PersistentCollection $coll)

Gets the SQL parameters for the corresponding SQL statement to delete the given collection.

Parameters

PersistentCollection $coll

Return Value

array

void update(PersistentCollection $coll)

Updates the given collection, synchronizing its state with the database by inserting, updating and deleting individual elements.

Parameters

PersistentCollection $coll

Return Value

void

void deleteRows(PersistentCollection $coll)

Deletes rows.

Parameters

PersistentCollection $coll

Return Value

void

void insertRows(PersistentCollection $coll)

Inserts rows.

Parameters

PersistentCollection $coll

Return Value

void

integer count(PersistentCollection $coll)

Counts the size of this persistent collection.

Parameters

PersistentCollection $coll

Return Value

integer

Exceptions

BadMethodCallException

array slice(PersistentCollection $coll, integer $offset, integer $length = null)

Slices elements.

Parameters

PersistentCollection $coll
integer $offset
integer $length

Return Value

array

Exceptions

BadMethodCallException

boolean contains(PersistentCollection $coll, object $element)

Checks for existence of an element.

Parameters

PersistentCollection $coll
object $element

Return Value

boolean

Exceptions

BadMethodCallException

boolean containsKey(PersistentCollection $coll, mixed $key)

Checks for existence of a key.

Parameters

PersistentCollection $coll
mixed $key

Return Value

boolean

Exceptions

BadMethodCallException

mixed removeElement(PersistentCollection $coll, object $element)

Removes an element.

Parameters

PersistentCollection $coll
object $element

Return Value

mixed

Exceptions

BadMethodCallException

void removeKey(PersistentCollection $coll, mixed $key)

Removes an element by key.

Parameters

PersistentCollection $coll
mixed $key

Return Value

void

Exceptions

BadMethodCallException

mixed get(PersistentCollection $coll, mixed $index)

Gets an element by key.

Parameters

PersistentCollection $coll
mixed $index

Return Value

mixed

Exceptions

BadMethodCallException

abstract protected string getDeleteRowSQL(PersistentCollection $coll)

Gets the SQL statement used for deleting a row from the collection.

Parameters

PersistentCollection $coll

Return Value

string

abstract protected array getDeleteRowSQLParameters(PersistentCollection $coll, mixed $element)

Gets the SQL parameters for the corresponding SQL statement to delete the given element from the given collection.

Parameters

PersistentCollection $coll
mixed $element

Return Value

array

abstract protected string getUpdateRowSQL(PersistentCollection $coll)

Gets the SQL statement used for updating a row in the collection.

Parameters

PersistentCollection $coll

Return Value

string

abstract protected string getInsertRowSQL(PersistentCollection $coll)

Gets the SQL statement used for inserting a row in the collection.

Parameters

PersistentCollection $coll

Return Value

string

abstract protected array getInsertRowSQLParameters(PersistentCollection $coll, mixed $element)

Gets the SQL parameters for the corresponding SQL statement to insert the given element of the given collection into the database.

Parameters

PersistentCollection $coll
mixed $element

Return Value

array