ResultSetMapping
public class ResultSetMapping
Field Summary | |
---|---|
array | Maps alias names to class names. |
array | Maps column names in the result set to the alias they belong to. |
array | Map from column names to class names that declare the field the column is mapped to. |
array | List of columns in the result set that are used as discriminator columns. |
array | Maps column names in the result set to field names for each class. |
array | Maps alias names to field names that should be used for indexing. |
boolean | Whether the result is mixed (contains scalar values together with field values). |
array | Maps column names of meta columns (foreign keys, discriminator columns, ...) to field names. |
array | Maps alias names to parent alias names. |
array | Maps alias names to related association field names. |
array | Maps column names in the result set to the alias/field name to use in the mapped result. |
Method Summary | |
---|---|
void | addEntityResult(string class, string alias) Adds an entity result to this ResultSetMapping. |
void | addFieldResult(string alias, string columnName, string fieldName, string declaringClass) Adds a field to the result that belongs to an entity or joined entity. |
void | addIndexBy(string alias, string fieldName) Sets a field to use for indexing an entity result or joined entity result. |
void | addJoinedEntityResult(string class, string alias, string parentAlias, object relation) Adds a joined entity result. |
void | addMetaResult(mixed alias, mixed columnName, mixed fieldName, $fieldName ) Adds a meta column (foreign key or discriminator column) to the result set. |
void | addScalarResult(string columnName, string alias) Adds a scalar result mapping. |
array | |
string | getClassName(string alias) Gets the name of the class of an entity result or joined entity result, identified by the given unique alias. |
string | getDeclaringClass(string columnName) Gets the name of the class that owns a field mapping for the specified column. |
string | getEntityAlias(string columnName) Gets the alias of the class that owns a field mapping for the specified column. |
integer | Gets the number of different entities that appear in the mapped result. |
string | getFieldName(string columnName) Gets the field name for a column name. |
string | getParentAlias(string alias) Gets the parent alias of the given alias. |
AssociationMapping | getRelation(string alias) |
string | getScalarAlias(string columnName) Gets the field alias for a column that is mapped as a scalar value. |
boolean | hasIndexBy(string alias) Checks whether an entity result or joined entity result with a given alias has a field set for indexing. |
boolean | hasParentAlias(string alias) Checks whether the given alias has a parent alias. |
boolean | isFieldResult(string columnName) Checks whether the column with the given name is mapped as a field result as part of an entity result or joined entity result. |
boolean | Checks whether this ResultSetMapping defines a mixed result. |
boolean | isRelation(string alias) |
boolean | isScalarResult(mixed columnName, string columName) Checks whether a column with a given name is mapped as a scalar result. |
void | setDiscriminatorColumn(string alias, string discrColumn) Sets a discriminator column for an entity result or joined entity result. |
public array $aliasMap = array()
Maps alias names to class names.
public array $columnOwnerMap = array()
Maps column names in the result set to the alias they belong to.
public array $declaringClasses = array()
Map from column names to class names that declare the field the column is mapped to.
public array $discriminatorColumns = array()
List of columns in the result set that are used as discriminator columns.
public array $fieldMappings = array()
Maps column names in the result set to field names for each class.
public array $indexByMap = array()
Maps alias names to field names that should be used for indexing.
public boolean $isMixed = false
Whether the result is mixed (contains scalar values together with field values).
public array $metaMappings = array()
Maps column names of meta columns (foreign keys, discriminator columns, ...) to field names.
public array $parentAliasMap = array()
Maps alias names to parent alias names.
public array $relationMap = array()
Maps alias names to related association field names.
public array $scalarMappings = array()
Maps column names in the result set to the alias/field name to use in the mapped result.
public void addEntityResult(string class, string alias)
Adds an entity result to this ResultSetMapping.
public void addFieldResult(string alias, string columnName, string fieldName, string declaringClass)
Adds a field to the result that belongs to an entity or joined entity.
public void addIndexBy(string alias, string fieldName)
Sets a field to use for indexing an entity result or joined entity result.
public void addJoinedEntityResult(string class, string alias, string parentAlias, object relation)
Adds a joined entity result.
public void addMetaResult(mixed alias, mixed columnName, mixed fieldName, $fieldName )
Adds a meta column (foreign key or discriminator column) to the result set.
public void addScalarResult(string columnName, string alias)
Adds a scalar result mapping.
public array getAliasMap()
public string getClassName(string alias)
Gets the name of the class of an entity result or joined entity result, identified by the given unique alias.
public string getDeclaringClass(string columnName)
Gets the name of the class that owns a field mapping for the specified column.
public string getEntityAlias(string columnName)
Gets the alias of the class that owns a field mapping for the specified column.
public integer getEntityResultCount()
Gets the number of different entities that appear in the mapped result.
public string getFieldName(string columnName)
Gets the field name for a column name.
public string getParentAlias(string alias)
Gets the parent alias of the given alias.
public AssociationMapping getRelation(string alias)
public string getScalarAlias(string columnName)
Gets the field alias for a column that is mapped as a scalar value.
public boolean hasIndexBy(string alias)
Checks whether an entity result or joined entity result with a given alias has a field set for indexing.
public boolean hasParentAlias(string alias)
Checks whether the given alias has a parent alias.
public boolean isFieldResult(string columnName)
Checks whether the column with the given name is mapped as a field result as part of an entity result or joined entity result.
public boolean isMixedResult()
Checks whether this ResultSetMapping defines a mixed result. Mixed results can only occur in object and array (graph) hydration. In such a case a mixed result means that scalar values are mixed with objects/array in the result.
public boolean isRelation(string alias)
public boolean isScalarResult(mixed columnName, string columName)
Checks whether a column with a given name is mapped as a scalar result.
public void setDiscriminatorColumn(string alias, string discrColumn)
Sets a discriminator column for an entity result or joined entity result. The discriminator column will be used to determine the concrete class name to instantiate.
A ResultSetMapping describes how a result set of an SQL query maps to a Doctrine result.
IMPORTANT NOTE: The properties of this class are only public for fast internal READ access and to (drastically) reduce the size of serialized instances for more effective caching due to better (un-)serialization performance.
Users should use the public methods.