Documentation

JoinedSubclassPersister extends AbstractEntityInheritancePersister
in package
Uses SQLResultCasing

The joined subclass persister maps a single entity instance to several tables in the database as it is defined by the <tt>Class Table Inheritance</tt> strategy.

Tags
see
https://martinfowler.com/eaaCatalog/classTableInheritance.html

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
$owningTableMap  : mixed
Map that maps column names to the table names that own them.
$quotedTableMap  : mixed
Map of table to quoted table names.

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()  : mixed
{@inheritDoc}
executeInserts()  : mixed
{@inheritDoc}
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()  : mixed
{@inheritDoc}
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()  : mixed
{@inheritDoc}
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()  : mixed
{@inheritDoc}
assignDefaultVersionAndUpsertableValues()  : mixed
{@inheritDoc}
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()  : mixed
{@inheritDoc}
getJoinSQLForJoinColumns()  : string
Generates the appropriate join SQL for the given join column.
getLockTablesSql()  : mixed
{@inheritDoc}
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
Ensure this method is never called. This persister overrides getSelectEntitiesSQL directly.
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.
getJoinSql()  : string
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.
getVersionedClassMetadata()  : ClassMetadata
This function finds the ClassMetadata instance in an inheritance hierarchy that is responsible for enabling versioning.
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

$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
see

prepareInsertData($entity)

see

prepareUpdateData($entity)

$conn

The underlying DBAL Connection of the used EntityManager.

protected Connection $conn

$queuedInserts

Queued inserts.

protected mixed $queuedInserts = []
Tags
psalm-var

array<int, object>

$quotedColumns

The map of quoted column names.

protected array<string|int, mixed> $quotedColumns = []
Tags
see

prepareInsertData($entity)

see

prepareUpdateData($entity)

$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']

$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.

$owningTableMap

Map that maps column names to the table names that own them.

private mixed $owningTableMap = []

This is mainly a temporary cache, used during a single request.

Tags
psalm-var

array<string, string>

$quotedTableMap

Map of table to quoted table names.

private mixed $quotedTableMap = []
Tags
psalm-var

array<string, string>

Methods

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
int

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

getCountSQL()

{@inheritDoc}

public getCountSQL([mixed $criteria = [] ]) : mixed
Parameters
$criteria : mixed = []

getInserts()

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
string

getManyToManyCollection()

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(string $fieldName) : string
Parameters
$fieldName : string
Return values
string

getSelectConditionStatementSQL()

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
string

getSelectSQL()

{@inheritDoc}

public getSelectSQL(mixed $criteria[, mixed $assoc = null ][, mixed $lockMode = null ][, mixed $limit = null ][, mixed $offset = null ][, array<string|int, mixed>|null $orderBy = null ]) : mixed
Parameters
$criteria : mixed
$assoc : mixed = null
$lockMode : mixed = null
$limit : mixed = null
$offset : mixed = null
$orderBy : array<string|int, mixed>|null = null

getSQLColumnAlias()

public getSQLColumnAlias(string $columnName) : string
Parameters
$columnName : string
Return values
string

load()

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.

assignDefaultVersionAndUpsertableValues()

{@inheritDoc}

protected assignDefaultVersionAndUpsertableValues(mixed $entity, array<string|int, mixed> $id) : mixed
Parameters
$entity : mixed
$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
todo

Add check for platform if it supports foreign keys/cascading.

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.

getDiscriminatorColumnTableName()

Gets the name of the table that contains the discriminator column.

protected getDiscriminatorColumnTableName() : string
Return values
string

The table name.

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
psalm-param

array<array<string, mixed>> $joinColumns

Return values
string

LEFT JOIN if one of the columns is nullable, INNER JOIN otherwise.

getLockTablesSql()

{@inheritDoc}

protected getLockTablesSql(mixed $lockMode) : mixed
Parameters
$lockMode : mixed

getOrderBySQL()

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
psalm-param

array<string, string> $orderBy

throws
InvalidOrientation
throws
InvalidFindByCall
throws
UnrecognizedField
Return values
string

getSelectColumnAssociationSQL()

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
string

getSelectColumnSQL()

Gets the SQL snippet of a qualified column name for the given field name.

protected getSelectColumnSQL(string $field, ClassMetadata $class[, string $alias = 'r' ]) : string
Parameters
$field : string

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 : string = 'r'
Return values
string

getSelectColumnsSQL()

Ensure this method is never called. This persister overrides getSelectEntitiesSQL directly.

protected getSelectColumnsSQL() : string
Return values
string

getSelectConditionCriteriaSQL()

Gets the Select Where Condition from a Criteria object.

protected getSelectConditionCriteriaSQL(Criteria $criteria) : string
Parameters
$criteria : Criteria
Return values
string

getSelectConditionSQL()

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
psalm-param

array<string, mixed> $criteria

psalm-param

array<string, mixed>|null $assoc

Return values
string

getSelectJoinColumnSQL()

protected getSelectJoinColumnSQL(string $tableAlias, string $joinColumnName, string $quotedColumnName, string $type) : string
Parameters
$tableAlias : string
$joinColumnName : string
$quotedColumnName : string
$type : string
Return values
string

getSelectManyToManyJoinSQL()

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
psalm-param

AssociationMapping $manyToMany

Return values
string

getSQLTableAlias()

Gets the SQL table alias for the given class name.

protected getSQLTableAlias(string $className[, string $assocName = '' ]) : string
Parameters
$className : string
$assocName : string = ''
Tags
todo

Reconsider. Binding table aliases to class names is not such a good idea.

Return values
string

The SQL table alias.

prepareInsertData()

Prepares the data changeset of a managed entity for database insertion (initial INSERT).

protected prepareInsertData(object $entity) : array<string|int, array<string|int, mixed>>

The changeset of the entity is obtained from the currently running UnitOfWork.

The default insert data preparation is the same as for updates.

Parameters
$entity : object

The entity for which to prepare the data.

Tags
see
prepareUpdateData
psalm-return

array<string, mixed[]>

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> => pairs, grouped by table name.

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
psalm-return

array<string, array<array-key, mixed|null>>

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
throws
UnrecognizedField
throws
OptimisticLockException

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
psalm-return

array{0: array, 1: list<int|string|null>}

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
psalm-return

list<int|string|null>

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
psalm-return

list

Return values
array<string|int, mixed>

getJoinSql()

private getJoinSql(string $baseTableAlias) : string
Parameters
$baseTableAlias : string
Return values
string

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
psalm-param

array<string, mixed> $assoc

throws
MappingException
Return values
Result

getOneToManyStatement()

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
psalm-param

AssociationMapping $assoc

Return values
Result

getSelectConditionStatementColumnSQL()

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
psalm-param

AssociationMapping|null $assoc

psalm-return

list

throws
InvalidFindByCall
throws
UnrecognizedField
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
psalm-return

list<int|string|null>

throws
QueryException
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
Return values
array<string|int, mixed>

        
On this page

Search results