DDC-117 - Slight changes in the patch and fixing inline comments.
This commit is contained in:
parent
194a90923d
commit
c2bbaa9ead
@ -50,7 +50,7 @@ class AssignedGenerator extends AbstractIdGenerator
|
|||||||
$value = $class->getReflectionProperty($idField)->getValue($entity);
|
$value = $class->getReflectionProperty($idField)->getValue($entity);
|
||||||
if (isset($value)) {
|
if (isset($value)) {
|
||||||
if (is_object($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));
|
$identifier[$idField] = current($em->getUnitOfWork()->getEntityIdentifier($value));
|
||||||
} else {
|
} else {
|
||||||
$identifier[$idField] = $value;
|
$identifier[$idField] = $value;
|
||||||
@ -64,7 +64,7 @@ class AssignedGenerator extends AbstractIdGenerator
|
|||||||
$value = $class->reflFields[$idField]->getValue($entity);
|
$value = $class->reflFields[$idField]->getValue($entity);
|
||||||
if (isset($value)) {
|
if (isset($value)) {
|
||||||
if (is_object($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));
|
$identifier[$idField] = current($em->getUnitOfWork()->getEntityIdentifier($value));
|
||||||
} else {
|
} else {
|
||||||
$identifier[$idField] = $value;
|
$identifier[$idField] = $value;
|
||||||
|
@ -1144,7 +1144,6 @@ class BasicEntityPersister
|
|||||||
}
|
}
|
||||||
$conditionSql .= $this->_class->getQuotedColumnName($field, $this->_platform);
|
$conditionSql .= $this->_class->getQuotedColumnName($field, $this->_platform);
|
||||||
} else if (isset($this->_class->associationMappings[$field])) {
|
} 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']) {
|
if (!$this->_class->associationMappings[$field]['isOwningSide']) {
|
||||||
throw ORMException::invalidFindByInverseAssociation($this->_class->name, $field);
|
throw ORMException::invalidFindByInverseAssociation($this->_class->name, $field);
|
||||||
}
|
}
|
||||||
|
@ -994,6 +994,7 @@ class SqlWalker implements TreeWalker
|
|||||||
$this->_rsm->addFieldResult($dqlAlias, $columnAlias, $fieldName, $class->name);
|
$this->_rsm->addFieldResult($dqlAlias, $columnAlias, $fieldName, $class->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($class->containsForeignIdentifier) {
|
||||||
// Add double entry for association identifier columns to simplify hydrator code
|
// Add double entry for association identifier columns to simplify hydrator code
|
||||||
foreach ($class->identifier AS $idField) {
|
foreach ($class->identifier AS $idField) {
|
||||||
if (isset($class->associationMappings[$idField])) {
|
if (isset($class->associationMappings[$idField])) {
|
||||||
@ -1014,6 +1015,7 @@ class SqlWalker implements TreeWalker
|
|||||||
$this->_rsm->addMetaResult($dqlAlias, $columnAlias, $idField);
|
$this->_rsm->addMetaResult($dqlAlias, $columnAlias, $idField);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Add any additional fields of subclasses (excluding inherited fields)
|
// Add any additional fields of subclasses (excluding inherited fields)
|
||||||
// 1) on Single Table Inheritance: always, since its marginal overhead
|
// 1) on Single Table Inheritance: always, since its marginal overhead
|
||||||
|
Loading…
x
Reference in New Issue
Block a user