class ManyToManyPersister extends AbstractCollectionPersister (View source)

Persister for many-to-many collections.

Properties

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

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.

integer
count(PersistentCollection $coll)

Counts the size of this persistent collection.

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

No description

boolean
contains(PersistentCollection $coll, object $element)

No description

boolean
containsKey(PersistentCollection $coll, mixed $key)

Checks for existence of a key.

mixed
removeElement(PersistentCollection $coll, object $element)

No description

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.

string
getFilterSql(array $mapping)

Generates the filter SQL for a given mapping.

string
generateFilterConditionSQL(ClassMetadata $targetEntity, string $targetTableAlias)

Generates the filter SQL for a given entity and table alias.

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

protected string getDeleteSQL(PersistentCollection $coll)

Gets the SQL statement for deleting the given collection.

Parameters

PersistentCollection $coll

Return Value

string

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)

Parameters

PersistentCollection $coll
integer $offset
integer $length

Return Value

array

boolean contains(PersistentCollection $coll, object $element)

Parameters

PersistentCollection $coll
object $element

Return Value

boolean

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)

Parameters

PersistentCollection $coll
object $element

Return Value

mixed

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

protected string getDeleteRowSQL(PersistentCollection $coll)

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

Parameters

PersistentCollection $coll

Return Value

string

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

protected string getUpdateRowSQL(PersistentCollection $coll)

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

Parameters

PersistentCollection $coll

Return Value

string

protected string getInsertRowSQL(PersistentCollection $coll)

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

Parameters

PersistentCollection $coll

Return Value

string

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

string getFilterSql(array $mapping)

Generates the filter SQL for a given mapping.

This method is not used for actually grabbing the related entities but when the extra-lazy collection methods are called on a filtered association. This is why besides the many to many table we also have to join in the actual entities table leading to additional JOIN.

Parameters

array $mapping Array containing mapping information.

Return Value

string The SQL query part to add to a query.

protected string generateFilterConditionSQL(ClassMetadata $targetEntity, string $targetTableAlias)

Generates the filter SQL for a given entity and table alias.

Parameters

ClassMetadata $targetEntity Metadata of the target entity.
string $targetTableAlias The table alias of the joined/selected table.

Return Value

string The SQL query part to add to a query.