AbstractEntityInheritancePersister
extends BasicEntityPersister
in package
Base class for entity persisters that implement a certain inheritance mapping strategy.
All these persisters are assumed to use a discriminator column to discriminate entity types in the hierarchy.
Table of Contents
Properties
- $class : ClassMetadata
- Metadata object that describes the mapping of the mapped entity class.
- $columnTypes : array<string|int, mixed>
- The map of column names to DBAL mapping types of all prepared columns used when INSERTing or UPDATEing an entity.
- $conn : Connection
- The underlying DBAL Connection of the used EntityManager.
- $currentPersisterContext : CachedPersisterContext
- $em : EntityManagerInterface
- The EntityManager instance.
- $platform : AbstractPlatform
- The database platform.
- $queuedInserts : mixed
- Queued inserts.
- $quotedColumns : array<string|int, mixed>
- The map of quoted column names.
- $quoteStrategy : QuoteStrategy
- The quote strategy.
- $comparisonMap : array<string, string>
- $identifierFlattener : IdentifierFlattener
- The IdentifierFlattener used for manipulating identifiers
- $insertSql : string|null
- The INSERT SQL statement used for entities handled by this persister.
- $limitsHandlingContext : CachedPersisterContext
- $noLimitsContext : CachedPersisterContext
Methods
- __construct() : mixed
- Initializes a new <tt>BasicEntityPersister</tt> that uses the given EntityManager and persists instances of the class described by the given ClassMetadata descriptor.
- addInsert() : void
- Adds an entity to the queued insertions.
- count() : int
- Count entities (optionally filtered by a criteria)
- delete() : bool
- Deletes a managed entity.
- executeInserts() : mixed
- Executes all queued entity insertions and returns any generated post-insert identifiers that were created as a result of the insertions.
- exists() : bool
- Checks whether the given managed entity exists in the database.
- expandCriteriaParameters() : mixed
- Expands Criteria Parameters by walking the expressions and grabbing all parameters and types from it.
- expandParameters() : mixed
- Expands the parameters from the given criteria and use the correct binding types if found.
- getClassMetadata() : ClassMetadata
- getCountSQL() : string
- Get the COUNT SQL to count entities (optionally based on a criteria)
- getInserts() : array<string|int, object>
- Get all queued inserts.
- getInsertSQL() : string
- Gets the INSERT SQL used by the persister to persist a new entity.
- getManyToManyCollection() : array<string|int, mixed>
- Gets (sliced or full) elements of the given collection.
- getOneToManyCollection() : array<string|int, mixed>
- Returns an array with (sliced or full list) of elements in the specified collection.
- getOwningTable() : string
- Gets the name of the table that owns the column the given field is mapped to.
- getResultSetMapping() : ResultSetMapping
- Gets the ResultSetMapping used for hydration.
- getSelectConditionStatementSQL() : string
- Gets the SQL WHERE condition for matching a field with a given value.
- getSelectSQL() : string
- Gets the SELECT SQL to select one or more entities by a set of field criteria.
- getSQLColumnAlias() : string
- load() : object|null
- Loads an entity by a list of field criteria.
- loadAll() : mixed
- Loads a list of entities by a list of field criteria.
- loadById() : object|null
- Loads an entity by identifier.
- loadCriteria() : array<string|int, mixed>
- Loads Entities matching the given Criteria object.
- loadManyToManyCollection() : array<string|int, mixed>
- Loads a collection of entities of a many-to-many association.
- loadOneToManyCollection() : mixed
- Loads a collection of entities in a one-to-many association.
- loadOneToOneEntity() : object
- Loads an entity of this persister's mapped class as part of a single-valued association from another entity.
- lock() : void
- Locks all rows of this entity matching the given criteria with the specified pessimistic lock mode.
- refresh() : void
- Refreshes a managed entity.
- update() : void
- Updates a managed entity. The entity is updated according to its current changeset in the running UnitOfWork. If there is no changeset, nothing is updated.
- assignDefaultVersionAndUpsertableValues() : void
- Retrieves the default version value which was created by the preceding INSERT statement and assigns it back in to the entities version field if the given entity is versioned.
- deleteJoinTableRecords() : void
- fetchVersionAndNotUpsertableValues() : mixed
- Fetches the current version value of a versioned entity and / or the values of fields marked as 'not insertable' and / or 'not updatable'.
- generateFilterConditionSQL() : string
- Generates the filter SQL for a given entity and table alias.
- getClassIdentifiersTypes() : array<string|int, string>
- getDiscriminatorColumnTableName() : string
- Gets the name of the table that contains the discriminator column.
- getInsertColumnList() : array<string|int, string>
- Gets the list of columns to put in the INSERT SQL statement.
- getJoinSQLForJoinColumns() : string
- Generates the appropriate join SQL for the given join column.
- getLockTablesSql() : string
- Gets the FROM and optionally JOIN conditions to lock the entity managed by this persister.
- getOrderBySQL() : string
- Gets the ORDER BY SQL snippet for ordered collections.
- getSelectColumnAssociationSQL() : string
- Gets the SQL join fragment used when selecting entities from an association.
- getSelectColumnSQL() : string
- Gets the SQL snippet of a qualified column name for the given field name.
- getSelectColumnsSQL() : string
- Gets the SQL fragment with the list of columns to select when querying for an entity in this persister.
- getSelectConditionCriteriaSQL() : string
- Gets the Select Where Condition from a Criteria object.
- getSelectConditionSQL() : string
- Gets the conditional SQL fragment used in the WHERE clause when selecting entities in this persister.
- getSelectJoinColumnSQL() : string
- getSelectManyToManyJoinSQL() : string
- Gets the SQL join fragment used when selecting entities from a many-to-many association.
- getSQLTableAlias() : string
- Gets the SQL table alias for the given class name.
- prepareInsertData() : array<string|int, array<string|int, mixed>>
- Prepares the data changeset of a managed entity for database insertion (initial INSERT).
- prepareUpdateData() : array<string|int, array<string|int, mixed>>
- Prepares the changeset of an entity for database insertion (UPDATE).
- switchPersisterContext() : void
- Switches persister context according to current query offset/limits
- updateTable() : void
- Performs an UPDATE statement for an entity on a specific table.
- expandToManyParameters() : array<string|int, array<string|int, mixed>>
- Expands the parameters from the given criteria and use the correct binding types if found, specialized for OneToMany or ManyToMany associations.
- extractIdentifierTypes() : array<string|int, int>|array<string|int, null>|array<string|int, string>
- getIndividualValue() : array<string|int, mixed>
- Retrieves an individual parameter value.
- getManyToManyStatement() : Result
- getOneToManyStatement() : Result
- Builds criteria and execute SQL statement to fetch the one to many entities from.
- getSelectConditionStatementColumnSQL() : array<string|int, string>
- Builds the left-hand-side of a where condition statement.
- getTypes() : array<string|int, int>|array<string|int, null>|array<string|int, string>
- Infers field types to be used by parameter type casting.
- getValues() : array<string|int, mixed>
- Retrieves the parameters that identifies a value.
- loadArrayFromResult() : array<string|int, mixed>
- Loads an array of entities from a given DBAL statement.
- loadCollectionFromStatement() : array<string|int, mixed>
- Hydrates a collection from a given DBAL statement.
Properties
$class
Metadata object that describes the mapping of the mapped entity class.
protected
ClassMetadata
$class
$columnTypes
The map of column names to DBAL mapping types of all prepared columns used when INSERTing or UPDATEing an entity.
protected
array<string|int, mixed>
$columnTypes
= []
Tags
$conn
The underlying DBAL Connection of the used EntityManager.
protected
Connection
$conn
$currentPersisterContext
protected
CachedPersisterContext
$currentPersisterContext
$em
The EntityManager instance.
protected
EntityManagerInterface
$em
$platform
The database platform.
protected
AbstractPlatform
$platform
$queuedInserts
Queued inserts.
protected
mixed
$queuedInserts
= []
Tags
$quotedColumns
The map of quoted column names.
protected
array<string|int, mixed>
$quotedColumns
= []
Tags
$quoteStrategy
The quote strategy.
protected
QuoteStrategy
$quoteStrategy
$comparisonMap
private
static array<string, string>
$comparisonMap
= [\Doctrine\Common\Collections\Expr\Comparison::EQ => '= %s', \Doctrine\Common\Collections\Expr\Comparison::NEQ => '!= %s', \Doctrine\Common\Collections\Expr\Comparison::GT => '> %s', \Doctrine\Common\Collections\Expr\Comparison::GTE => '>= %s', \Doctrine\Common\Collections\Expr\Comparison::LT => '< %s', \Doctrine\Common\Collections\Expr\Comparison::LTE => '<= %s', \Doctrine\Common\Collections\Expr\Comparison::IN => 'IN (%s)', \Doctrine\Common\Collections\Expr\Comparison::NIN => 'NOT IN (%s)', \Doctrine\Common\Collections\Expr\Comparison::CONTAINS => 'LIKE %s', \Doctrine\Common\Collections\Expr\Comparison::STARTS_WITH => 'LIKE %s', \Doctrine\Common\Collections\Expr\Comparison::ENDS_WITH => 'LIKE %s']
$identifierFlattener
The IdentifierFlattener used for manipulating identifiers
private
IdentifierFlattener
$identifierFlattener
$insertSql
The INSERT SQL statement used for entities handled by this persister.
private
string|null
$insertSql
This SQL is only generated once per request, if at all.
$limitsHandlingContext
private
CachedPersisterContext
$limitsHandlingContext
$noLimitsContext
private
CachedPersisterContext
$noLimitsContext
Methods
__construct()
Initializes a new <tt>BasicEntityPersister</tt> that uses the given EntityManager and persists instances of the class described by the given ClassMetadata descriptor.
public
__construct(EntityManagerInterface $em, ClassMetadata $class) : mixed
Parameters
- $em : EntityManagerInterface
- $class : ClassMetadata
addInsert()
Adds an entity to the queued insertions.
public
addInsert(mixed $entity) : void
Parameters
- $entity : mixed
-
The entity to queue for insertion.
count()
Count entities (optionally filtered by a criteria)
public
count([mixed $criteria = [] ]) : int
Parameters
- $criteria : mixed = []
Return values
intdelete()
Deletes a managed entity.
public
delete(mixed $entity) : bool
Parameters
- $entity : mixed
-
The entity to delete.
Return values
bool —TRUE if the entity got deleted in the database, FALSE otherwise.
executeInserts()
Executes all queued entity insertions and returns any generated post-insert identifiers that were created as a result of the insertions.
public
executeInserts() : mixed
exists()
Checks whether the given managed entity exists in the database.
public
exists(mixed $entity[, Criteria|null $extraConditions = null ]) : bool
Parameters
- $entity : mixed
- $extraConditions : Criteria|null = null
Return values
bool —TRUE if the entity exists in the database, FALSE otherwise.
expandCriteriaParameters()
Expands Criteria Parameters by walking the expressions and grabbing all parameters and types from it.
public
expandCriteriaParameters(Criteria $criteria) : mixed
Parameters
- $criteria : Criteria
expandParameters()
Expands the parameters from the given criteria and use the correct binding types if found.
public
expandParameters(mixed $criteria) : mixed
Parameters
- $criteria : mixed
getClassMetadata()
public
getClassMetadata() : ClassMetadata
Return values
ClassMetadatagetCountSQL()
Get the COUNT SQL to count entities (optionally based on a criteria)
public
getCountSQL([mixed $criteria = [] ]) : string
Parameters
- $criteria : mixed = []
Return values
stringgetInserts()
Get all queued inserts.
public
getInserts() : array<string|int, object>
Return values
array<string|int, object>getInsertSQL()
Gets the INSERT SQL used by the persister to persist a new entity.
public
getInsertSQL() : string
Return values
stringgetManyToManyCollection()
Gets (sliced or full) elements of the given collection.
public
getManyToManyCollection(array<string|int, mixed> $assoc, mixed $sourceEntity[, mixed $offset = null ][, mixed $limit = null ]) : array<string|int, mixed>
Parameters
- $assoc : array<string|int, mixed>
- $sourceEntity : mixed
- $offset : mixed = null
- $limit : mixed = null
Return values
array<string|int, mixed>getOneToManyCollection()
Returns an array with (sliced or full list) of elements in the specified collection.
public
getOneToManyCollection(array<string|int, mixed> $assoc, mixed $sourceEntity[, mixed $offset = null ][, mixed $limit = null ]) : array<string|int, mixed>
Parameters
- $assoc : array<string|int, mixed>
- $sourceEntity : mixed
- $offset : mixed = null
- $limit : mixed = null
Return values
array<string|int, mixed>getOwningTable()
Gets the name of the table that owns the column the given field is mapped to.
public
getOwningTable(mixed $fieldName) : string
Parameters
- $fieldName : mixed
-
The field name.
Return values
string —The table name.
getResultSetMapping()
Gets the ResultSetMapping used for hydration.
public
getResultSetMapping() : ResultSetMapping
Return values
ResultSetMappinggetSelectConditionStatementSQL()
Gets the SQL WHERE condition for matching a field with a given value.
public
getSelectConditionStatementSQL(mixed $field, mixed $value[, mixed $assoc = null ][, mixed $comparison = null ]) : string
Parameters
- $field : mixed
- $value : mixed
- $assoc : mixed = null
- $comparison : mixed = null
Return values
stringgetSelectSQL()
Gets the SELECT SQL to select one or more entities by a set of field criteria.
public
getSelectSQL(mixed $criteria[, mixed $assoc = null ][, mixed $lockMode = null ][, mixed $limit = null ][, mixed $offset = null ][, array<string|int, mixed>|null $orderBy = null ]) : string
Parameters
- $criteria : mixed
- $assoc : mixed = null
- $lockMode : mixed = null
- $limit : mixed = null
- $offset : mixed = null
- $orderBy : array<string|int, mixed>|null = null
Return values
stringgetSQLColumnAlias()
public
getSQLColumnAlias(string $columnName) : string
Parameters
- $columnName : string
Return values
stringload()
Loads an entity by a list of field criteria.
public
load(array<string|int, mixed> $criteria[, mixed $entity = null ][, mixed $assoc = null ][, array<string|int, mixed> $hints = [] ][, mixed $lockMode = null ][, mixed $limit = null ][, array<string|int, mixed>|null $orderBy = null ]) : object|null
Parameters
- $criteria : array<string|int, mixed>
-
The criteria by which to load the entity.
- $entity : mixed = null
-
The entity to load the data into. If not specified, a new entity is created.
- $assoc : mixed = null
-
The association that connects the entity to load to another entity, if any.
- $hints : array<string|int, mixed> = []
-
Hints for entity creation.
- $lockMode : mixed = null
-
One of the \Doctrine\DBAL\LockMode::* constants or NULL if no specific lock mode should be used for loading the entity.
- $limit : mixed = null
-
Limit number of results.
- $orderBy : array<string|int, mixed>|null = null
-
Criteria to order by.
Return values
object|null —The loaded and managed entity instance or NULL if the entity can not be found.
loadAll()
Loads a list of entities by a list of field criteria.
public
loadAll([array<string|int, mixed> $criteria = [] ][, array<string|int, mixed>|null $orderBy = null ][, mixed $limit = null ][, mixed $offset = null ]) : mixed
Parameters
- $criteria : array<string|int, mixed> = []
- $orderBy : array<string|int, mixed>|null = null
- $limit : mixed = null
- $offset : mixed = null
loadById()
Loads an entity by identifier.
public
loadById(array<string|int, mixed> $identifier[, mixed $entity = null ]) : object|null
Parameters
- $identifier : array<string|int, mixed>
- $entity : mixed = null
-
The entity to load the data into. If not specified, a new entity is created.
Return values
object|null —The loaded and managed entity instance or NULL if the entity can not be found.
loadCriteria()
Loads Entities matching the given Criteria object.
public
loadCriteria(Criteria $criteria) : array<string|int, mixed>
Parameters
- $criteria : Criteria
Return values
array<string|int, mixed>loadManyToManyCollection()
Loads a collection of entities of a many-to-many association.
public
loadManyToManyCollection(array<string|int, mixed> $assoc, mixed $sourceEntity, PersistentCollection $collection) : array<string|int, mixed>
Parameters
- $assoc : array<string|int, mixed>
- $sourceEntity : mixed
-
The entity that owns the collection.
- $collection : PersistentCollection
-
The collection to fill.
Return values
array<string|int, mixed>loadOneToManyCollection()
Loads a collection of entities in a one-to-many association.
public
loadOneToManyCollection(array<string|int, mixed> $assoc, mixed $sourceEntity, PersistentCollection $collection) : mixed
Parameters
- $assoc : array<string|int, mixed>
- $sourceEntity : mixed
- $collection : PersistentCollection
-
The collection to load/fill.
loadOneToOneEntity()
Loads an entity of this persister's mapped class as part of a single-valued association from another entity.
public
loadOneToOneEntity(array<string|int, mixed> $assoc, mixed $sourceEntity[, array<string|int, mixed> $identifier = [] ]) : object
Parameters
- $assoc : array<string|int, mixed>
- $sourceEntity : mixed
-
The entity that owns the association (not necessarily the "owning side").
- $identifier : array<string|int, mixed> = []
Return values
object —The loaded and managed entity instance or NULL if the entity can not be found.
lock()
Locks all rows of this entity matching the given criteria with the specified pessimistic lock mode.
public
lock(array<string|int, mixed> $criteria, mixed $lockMode) : void
Parameters
- $criteria : array<string|int, mixed>
- $lockMode : mixed
-
One of the Doctrine\DBAL\LockMode::* constants.
refresh()
Refreshes a managed entity.
public
refresh(array<string|int, mixed> $id, mixed $entity[, mixed $lockMode = null ]) : void
Parameters
- $id : array<string|int, mixed>
- $entity : mixed
-
The entity to refresh.
- $lockMode : mixed = null
-
One of the \Doctrine\DBAL\LockMode::* constants or NULL if no specific lock mode should be used for refreshing the managed entity.
update()
Updates a managed entity. The entity is updated according to its current changeset in the running UnitOfWork. If there is no changeset, nothing is updated.
public
update(mixed $entity) : void
Parameters
- $entity : mixed
-
The entity to update.
assignDefaultVersionAndUpsertableValues()
Retrieves the default version value which was created by the preceding INSERT statement and assigns it back in to the entities version field if the given entity is versioned.
protected
assignDefaultVersionAndUpsertableValues(object $entity, array<string|int, mixed> $id) : void
Also retrieves values of columns marked as 'non insertable' and / or 'not updatable' and assigns them back to the entities corresponding fields.
Parameters
- $entity : object
- $id : array<string|int, mixed>
deleteJoinTableRecords()
protected
deleteJoinTableRecords(array<string|int, mixed> $identifier, array<string|int, string> $types) : void
Parameters
- $identifier : array<string|int, mixed>
- $types : array<string|int, string>
Tags
fetchVersionAndNotUpsertableValues()
Fetches the current version value of a versioned entity and / or the values of fields marked as 'not insertable' and / or 'not updatable'.
protected
fetchVersionAndNotUpsertableValues(ClassMetadata $versionedClass, array<string|int, mixed> $id) : mixed
Parameters
- $versionedClass : ClassMetadata
- $id : array<string|int, mixed>
generateFilterConditionSQL()
Generates the filter SQL for a given entity and table alias.
protected
generateFilterConditionSQL(ClassMetadata $targetEntity, string $targetTableAlias) : string
Parameters
- $targetEntity : ClassMetadata
-
Metadata of the target entity.
- $targetTableAlias : string
-
The table alias of the joined/selected table.
Return values
string —The SQL query part to add to a query.
getClassIdentifiersTypes()
protected
getClassIdentifiersTypes(ClassMetadata $class) : array<string|int, string>
Parameters
- $class : ClassMetadata
Tags
Return values
array<string|int, string>getDiscriminatorColumnTableName()
Gets the name of the table that contains the discriminator column.
protected
abstract getDiscriminatorColumnTableName() : string
Return values
string —The table name.
getInsertColumnList()
Gets the list of columns to put in the INSERT SQL statement.
protected
getInsertColumnList() : array<string|int, string>
Subclasses should override this method to alter or change the list of columns placed in the INSERT statements used by the persister.
Tags
Return values
array<string|int, string> —The list of columns.
getJoinSQLForJoinColumns()
Generates the appropriate join SQL for the given join column.
protected
getJoinSQLForJoinColumns(array<string|int, array<string|int, mixed>> $joinColumns) : string
Parameters
- $joinColumns : array<string|int, array<string|int, mixed>>
-
The join columns definition of an association.
Tags
Return values
string —LEFT JOIN if one of the columns is nullable, INNER JOIN otherwise.
getLockTablesSql()
Gets the FROM and optionally JOIN conditions to lock the entity managed by this persister.
protected
getLockTablesSql(int|null $lockMode) : string
Parameters
- $lockMode : int|null
-
One of the Doctrine\DBAL\LockMode::* constants.
Tags
Return values
stringgetOrderBySQL()
Gets the ORDER BY SQL snippet for ordered collections.
protected
final getOrderBySQL(array<string|int, mixed> $orderBy, string $baseTableAlias) : string
Parameters
- $orderBy : array<string|int, mixed>
- $baseTableAlias : string
Tags
Return values
stringgetSelectColumnAssociationSQL()
Gets the SQL join fragment used when selecting entities from an association.
protected
getSelectColumnAssociationSQL(string $field, AssociationMapping $assoc, ClassMetadata $class[, string $alias = 'r' ]) : string
Parameters
- $field : string
- $assoc : AssociationMapping
- $class : ClassMetadata
- $alias : string = 'r'
Return values
stringgetSelectColumnSQL()
Gets the SQL snippet of a qualified column name for the given field name.
protected
getSelectColumnSQL(mixed $field, ClassMetadata $class[, mixed $alias = 'r' ]) : string
Parameters
- $field : mixed
-
The field name.
- $class : ClassMetadata
-
The class that declares this field. The table this class is mapped to must own the column for the given field.
- $alias : mixed = 'r'
Return values
stringgetSelectColumnsSQL()
Gets the SQL fragment with the list of columns to select when querying for an entity in this persister.
protected
getSelectColumnsSQL() : string
Subclasses should override this method to alter or change the select column list SQL fragment. Note that in the implementation of BasicEntityPersister the resulting SQL fragment is generated only once and cached in . Subclasses may or may not do the same.
Return values
string —The SQL fragment.
getSelectConditionCriteriaSQL()
Gets the Select Where Condition from a Criteria object.
protected
getSelectConditionCriteriaSQL(Criteria $criteria) : string
Parameters
- $criteria : Criteria
Return values
stringgetSelectConditionSQL()
Gets the conditional SQL fragment used in the WHERE clause when selecting entities in this persister.
protected
getSelectConditionSQL(array<string|int, mixed> $criteria[, AssociationMapping|null $assoc = null ]) : string
Subclasses are supposed to override this method if they intend to change or alter the criteria by which entities are selected.
Parameters
- $criteria : array<string|int, mixed>
- $assoc : AssociationMapping|null = null
Tags
Return values
stringgetSelectJoinColumnSQL()
protected
getSelectJoinColumnSQL(string $tableAlias, string $joinColumnName, string $quotedColumnName, string $type) : string
Parameters
- $tableAlias : string
- $joinColumnName : string
- $quotedColumnName : string
- $type : string
Return values
stringgetSelectManyToManyJoinSQL()
Gets the SQL join fragment used when selecting entities from a many-to-many association.
protected
getSelectManyToManyJoinSQL(array<string|int, mixed> $manyToMany) : string
Parameters
- $manyToMany : array<string|int, mixed>
Tags
Return values
stringgetSQLTableAlias()
Gets the SQL table alias for the given class name.
protected
getSQLTableAlias(string $className[, string $assocName = '' ]) : string
Parameters
- $className : string
- $assocName : string = ''
Tags
Return values
string —The SQL table alias.
prepareInsertData()
Prepares the data changeset of a managed entity for database insertion (initial INSERT).
protected
prepareInsertData(mixed $entity) : array<string|int, array<string|int, mixed>>
Parameters
- $entity : mixed
-
The entity for which to prepare the data.
Return values
array<string|int, array<string|int, mixed>> —The prepared data for the tables to update.
prepareUpdateData()
Prepares the changeset of an entity for database insertion (UPDATE).
protected
prepareUpdateData(object $entity[, bool $isInsert = false ]) : array<string|int, array<string|int, mixed>>
The changeset is obtained from the currently running UnitOfWork.
During this preparation the array that is passed as the second parameter is filled with
<columnName> =>
Example:
array(
'foo_table' => array('column1' => 'value1', 'column2' => 'value2', ...),
'bar_table' => array('columnX' => 'valueX', 'columnY' => 'valueY', ...),
...
)
Parameters
- $entity : object
-
The entity for which to prepare the data.
- $isInsert : bool = false
-
Whether the data to be prepared refers to an insert statement.
Tags
Return values
array<string|int, array<string|int, mixed>> —The prepared data.
switchPersisterContext()
Switches persister context according to current query offset/limits
protected
switchPersisterContext(int|null $offset, int|null $limit) : void
This is due to the fact that to-many associations cannot be fetch-joined when a limit is involved
Parameters
- $offset : int|null
- $limit : int|null
updateTable()
Performs an UPDATE statement for an entity on a specific table.
protected
final updateTable(object $entity, string $quotedTableName, array<string|int, mixed> $updateData[, bool $versioned = false ]) : void
The UPDATE can optionally be versioned, which requires the entity to have a version field.
Parameters
- $entity : object
-
The entity object being updated.
- $quotedTableName : string
-
The quoted name of the table to apply the UPDATE on.
- $updateData : array<string|int, mixed>
-
The map of columns to update (column => value).
- $versioned : bool = false
-
Whether the UPDATE should be versioned.
Tags
expandToManyParameters()
Expands the parameters from the given criteria and use the correct binding types if found, specialized for OneToMany or ManyToMany associations.
private
expandToManyParameters(array<string|int, array<string|int, mixed>> $criteria) : array<string|int, array<string|int, mixed>>
Parameters
- $criteria : array<string|int, array<string|int, mixed>>
-
an array of arrays containing following:
- field to which each criterion will be bound
- value to be bound
- class to which the field belongs to
Tags
Return values
array<string|int, array<string|int, mixed>>extractIdentifierTypes()
private
extractIdentifierTypes(array<string|int, mixed> $id, ClassMetadata $versionedClass) : array<string|int, int>|array<string|int, null>|array<string|int, string>
Parameters
- $id : array<string|int, mixed>
- $versionedClass : ClassMetadata
Tags
Return values
array<string|int, int>|array<string|int, null>|array<string|int, string>getIndividualValue()
Retrieves an individual parameter value.
private
getIndividualValue(mixed $value) : array<string|int, mixed>
Parameters
- $value : mixed
Tags
Return values
array<string|int, mixed>getManyToManyStatement()
private
getManyToManyStatement(array<string|int, mixed> $assoc, object $sourceEntity[, int|null $offset = null ][, int|null $limit = null ]) : Result
Parameters
- $assoc : array<string|int, mixed>
- $sourceEntity : object
- $offset : int|null = null
- $limit : int|null = null
Tags
Return values
ResultgetOneToManyStatement()
Builds criteria and execute SQL statement to fetch the one to many entities from.
private
getOneToManyStatement(array<string|int, mixed> $assoc, object $sourceEntity[, int|null $offset = null ][, int|null $limit = null ]) : Result
Parameters
- $assoc : array<string|int, mixed>
- $sourceEntity : object
- $offset : int|null = null
- $limit : int|null = null
Tags
Return values
ResultgetSelectConditionStatementColumnSQL()
Builds the left-hand-side of a where condition statement.
private
getSelectConditionStatementColumnSQL(string $field[, array<string|int, mixed>|null $assoc = null ]) : array<string|int, string>
Parameters
- $field : string
- $assoc : array<string|int, mixed>|null = null
Tags
Return values
array<string|int, string>getTypes()
Infers field types to be used by parameter type casting.
private
getTypes(string $field, mixed $value, ClassMetadata $class) : array<string|int, int>|array<string|int, null>|array<string|int, string>
Parameters
- $field : string
- $value : mixed
- $class : ClassMetadata
Tags
Return values
array<string|int, int>|array<string|int, null>|array<string|int, string>getValues()
Retrieves the parameters that identifies a value.
private
getValues(mixed $value) : array<string|int, mixed>
Parameters
- $value : mixed
Return values
array<string|int, mixed>loadArrayFromResult()
Loads an array of entities from a given DBAL statement.
private
loadArrayFromResult(array<string|int, mixed> $assoc, Result $stmt) : array<string|int, mixed>
Parameters
- $assoc : array<string|int, mixed>
- $stmt : Result
Return values
array<string|int, mixed>loadCollectionFromStatement()
Hydrates a collection from a given DBAL statement.
private
loadCollectionFromStatement(array<string|int, mixed> $assoc, Result $stmt, PersistentCollection $coll) : array<string|int, mixed>
Parameters
- $assoc : array<string|int, mixed>
- $stmt : Result
- $coll : PersistentCollection