Doctrine\ORM\Persisters\JoinedSubclassPersister
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.
- Author: Roman Borschel <roman@code-factory.org>
Synopsis
class JoinedSubclassPersister
extends AbstractEntityInheritancePersister
{
- // members
- private array $_owningTableMap;
- private array $_quotedTableMap;
- // Inherited members from BasicEntityPersister
- protected ClassMetadata $_class;
- protected Connection $_conn;
- protected AbstractPlatform $_platform;
- protected EntityManager $_em;
- protected array $_queuedInserts;
- protected ResultSetMapping $_rsm;
- protected array $_columnTypes;
- protected array $quotedColumns;
- protected string $_selectColumnListSql;
- protected string $_selectJoinSql;
- protected integer $_sqlAliasCounter;
- protected array $_sqlTableAliases;
- protected QuoteStrategy $quoteStrategy;
- // methods
- protected void _getDiscriminatorColumnTableName()
- private ClassMetadata _getVersionedClassMetadata()
- public string getOwningTable()
- public void executeInserts()
- public void update()
- public void delete()
- protected void _getSelectEntitiesSQL()
- public string getLockTablesSql()
- protected void _getSelectColumnListSQL()
- protected void _getInsertColumnList()
- protected void assignDefaultVersionValue()
- // Inherited methods from AbstractEntityInheritancePersister
- protected void _prepareInsertData()
- protected abstract string _getDiscriminatorColumnTableName()
- protected void _getSelectColumnSQL()
- protected void getSelectJoinColumnSQL()
- // Inherited methods from BasicEntityPersister
- public void __construct()
- public ClassMetadata getClassMetadata()
- public void addInsert()
- public array executeInserts()
- protected void assignDefaultVersionValue()
- protected mixed fetchVersionValue()
- public void update()
- protected final void _updateTable()
- protected void deleteJoinTableRecords()
- public void delete()
- protected array _prepareUpdateData()
- protected array _prepareInsertData()
- public string getOwningTable()
- public load()
- public loadOneToOneEntity()
- public void refresh()
- public array loadCriteria()
- public array loadAll()
- public array getManyToManyCollection()
- public array loadManyToManyCollection()
- protected string _getSelectEntitiesSQL()
- protected final string _getOrderBySQL()
- protected string _getSelectColumnListSQL()
- protected string _getSelectColumnAssociationSQL()
- protected string _getSelectManyToManyJoinSQL()
- protected string _getInsertSQL()
- protected array _getInsertColumnList()
- protected void _getSelectColumnSQL()
- protected string _getSQLTableAlias()
- public void lock()
- protected string getLockTablesSql()
- protected string _getSelectConditionCriteriaSQL()
- public string getSelectConditionStatementSQL()
- protected string getSelectConditionStatementColumnSQL()
- protected string _getSelectConditionSQL()
- public array getOneToManyCollection()
- public void loadOneToManyCollection()
- public boolean exists()
- protected string getJoinSQLForJoinColumns()
- public string getSQLColumnAlias()
- protected string generateFilterConditionSQL()
Hierarchy
Tasks
Line | Task |
---|---|
459+ | Add check for platform if it supports foreign keys/cascading. |
463 | this only covers scenarios with no inheritance or of the same level. Is there something |
666+ | Check identity map? loadById method? Try to guess whether $criteria is the id? |
1013+ | Refactor: _getSelectSQL(...) |
1096+ | Rename: _getSelectColumnsSQL() |
1367+ | Reconsider. Binding table aliases to class names is not such a good idea. |
Members
private
- $_owningTableMap
—
array
Map that maps column names to the table names that own them. - $_quotedTableMap
—
array
Map of table to quoted table names.
protected
- $_class
—
\Doctrine\ORM\Mapping\ClassMetadata
Metadata object that describes the mapping of the mapped entity class. - $_columnTypes
—
array
The map of column names to DBAL mapping types of all prepared columns used when INSERTing or UPDATEing an entity. - $_conn
—
\Doctrine\DBAL\Connection
The underlying DBAL Connection of the used EntityManager. - $_em
—
\Doctrine\ORM\EntityManager
The EntityManager instance. - $_platform
—
\Doctrine\DBAL\Platforms\AbstractPlatform
The database platform. - $_queuedInserts
—
array
Queued inserts. - $_rsm
—
Doctrine\ORM\Persisters\Query\ResultSetMapping
ResultSetMapping that is used for all queries. Is generated lazily once per request. - $_selectColumnListSql
—
string
The SELECT column list SQL fragment used for querying entities by this persister. - $_selectJoinSql
—
string
The JOIN SQL fragement used to eagerly load all many-to-one and one-to-one associations configured as FETCH_EAGER, aswell as all inverse one-to-one associations. - $_sqlAliasCounter
—
integer
Counter for creating unique SQL table and column aliases. - $_sqlTableAliases
—
array
Map from class names (FQCN) to the corresponding generated SQL table aliases. - $quoteStrategy
—
\Doctrine\ORM\Mapping\QuoteStrategy
The quote strategy. - $quotedColumns
—
array
The map of quoted column names.
Methods
private
- _getVersionedClassMetadata() — This function finds the ClassMetadata instance in an inheritance hierarchy that is responsible for enabling versioning.
protected
- _getDiscriminatorColumnTableName() — {@inheritdoc}
- _getInsertColumnList() — {@inheritdoc}
- _getSelectColumnListSQL()
- _getSelectEntitiesSQL() — {@inheritdoc}
- assignDefaultVersionValue() — {@inheritdoc}
public
- delete() — {@inheritdoc}
- executeInserts() — {@inheritdoc}
- getLockTablesSql() — Get the FROM and optionally JOIN conditions to lock the entity managed by this persister.
- getOwningTable() — Gets the name of the table that owns the column the given field is mapped to.
- update() — {@inheritdoc}
Inherited from Doctrine\ORM\Persisters\AbstractEntityInheritancePersister
protected
- _getDiscriminatorColumnTableName() — Gets the name of the table that contains the discriminator column.
- _getSelectColumnSQL() — {@inheritdoc}
- _prepareInsertData() — {@inheritdoc}
- getSelectJoinColumnSQL()
Inherited from Doctrine\ORM\Persisters\BasicEntityPersister
protected
- _getInsertColumnList() — Gets the list of columns to put in the INSERT SQL statement.
- _getInsertSQL() — Gets the INSERT SQL used by the persister to persist a new entity.
- _getOrderBySQL() — Gets the ORDER BY SQL snippet for ordered collections.
- _getSQLTableAlias() — Gets the SQL table alias for the given class name.
- _getSelectColumnAssociationSQL() — Gets the SQL join fragment used when selecting entities from an association.
- _getSelectColumnListSQL() — Gets the SQL fragment with the list of columns to select when querying for an entity in this persister.
- _getSelectColumnSQL() — Gets the SQL snippet of a qualified column name for the given field name.
- _getSelectConditionCriteriaSQL() — Get the Select Where Condition from a Criteria object.
- _getSelectConditionSQL() — Gets the conditional SQL fragment used in the WHERE clause when selecting entities in this persister.
- _getSelectEntitiesSQL() — Gets the SELECT SQL to select one or more entities by a set of field criteria.
- _getSelectManyToManyJoinSQL() — Gets the SQL join fragment used when selecting entities from a many-to-many association.
- _prepareInsertData() — Prepares the data changeset of a managed entity for database insertion (initial INSERT).
- _prepareUpdateData() — Prepares the changeset of an entity for database insertion (UPDATE).
- _updateTable() — Performs an UPDATE statement for an entity on a specific table.
- assignDefaultVersionValue() — Retrieves the default version value which was created by the preceding INSERT statement and assigns it back in to the entities version field.
- deleteJoinTableRecords()
- fetchVersionValue() — Fetch the current version value of a versioned entity.
- generateFilterConditionSQL() — Generates the filter SQL for a given entity and table alias.
- getJoinSQLForJoinColumns() — Generates the appropriate join SQL for the given join column.
- getLockTablesSql() — Get the FROM and optionally JOIN conditions to lock the entity managed by this persister.
- getSelectConditionStatementColumnSQL() — Build the left-hand-side of a where condition statement.
public
- addInsert() — Adds an entity to the queued insertions.
- delete() — Deletes a managed entity.
- executeInserts() — Executes all queued entity insertions and returns any generated post-insert identifiers that were created as a result of the insertions.
- exists() — Checks whether the given managed entity exists in the database.
- getClassMetadata()
- getManyToManyCollection() — Get (sliced or full) elements of the given collection.
- getOneToManyCollection() — Return an array with (sliced or full list) of elements in the specified collection.
- getOwningTable() — Gets the name of the table that owns the column the given field is mapped to.
- getSQLColumnAlias() — Gets an SQL column alias for a column name.
- getSelectConditionStatementSQL() — Get the SQL WHERE condition for matching a field with a given value.
- load() — Loads an entity by a list of field criteria.
- loadAll() — Loads a list of entities by a list of field criteria.
- loadCriteria() — Load Entities matching the given Criteria object
- loadManyToManyCollection() — Loads a collection of entities of a many-to-many association.
- loadOneToManyCollection() — Loads a collection of entities in a one-to-many association.
- loadOneToOneEntity() — Loads an entity of this persister's mapped class as part of a single-valued association from another entity.
- lock() — Lock all rows of this entity matching the given criteria with the specified pessimistic lock mode
- refresh() — Refreshes a 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.