1
0
mirror of synced 2025-02-21 22:53:15 +03:00

DDC-117 - Slight changes in the patch and fixing inline comments.

This commit is contained in:
Benjamin Eberlei 2011-01-01 18:53:22 +01:00
parent 194a90923d
commit c2bbaa9ead
3 changed files with 21 additions and 20 deletions

View File

@ -50,7 +50,7 @@ class AssignedGenerator extends AbstractIdGenerator
$value = $class->getReflectionProperty($idField)->getValue($entity);
if (isset($value)) {
if (is_object($value)) {
// TODO: Single Id only, i enforce that. Compoite Key as Foreign Keys Primary Key part sounds ugly
// NOTE: Single Columns as associated identifiers only allowed - this constraint it is enforced.
$identifier[$idField] = current($em->getUnitOfWork()->getEntityIdentifier($value));
} else {
$identifier[$idField] = $value;
@ -64,7 +64,7 @@ class AssignedGenerator extends AbstractIdGenerator
$value = $class->reflFields[$idField]->getValue($entity);
if (isset($value)) {
if (is_object($value)) {
// TODO: Single Id only, i enforce that. Compoite Key as Foreign Keys Primary Key part sounds ugly
// NOTE: Single Columns as associated identifiers only allowed - this constraint it is enforced.
$identifier[$idField] = current($em->getUnitOfWork()->getEntityIdentifier($value));
} else {
$identifier[$idField] = $value;

View File

@ -1144,7 +1144,6 @@ class BasicEntityPersister
}
$conditionSql .= $this->_class->getQuotedColumnName($field, $this->_platform);
} else if (isset($this->_class->associationMappings[$field])) {
// TODO: Composite Keys as Foreign Key PK? That would be super ugly! And should probably be disallowed ;)
if (!$this->_class->associationMappings[$field]['isOwningSide']) {
throw ORMException::invalidFindByInverseAssociation($this->_class->name, $field);
}

View File

@ -994,6 +994,7 @@ class SqlWalker implements TreeWalker
$this->_rsm->addFieldResult($dqlAlias, $columnAlias, $fieldName, $class->name);
}
if ($class->containsForeignIdentifier) {
// Add double entry for association identifier columns to simplify hydrator code
foreach ($class->identifier AS $idField) {
if (isset($class->associationMappings[$idField])) {
@ -1014,6 +1015,7 @@ class SqlWalker implements TreeWalker
$this->_rsm->addMetaResult($dqlAlias, $columnAlias, $idField);
}
}
}
// Add any additional fields of subclasses (excluding inherited fields)
// 1) on Single Table Inheritance: always, since its marginal overhead