1
0
mirror of synced 2025-02-20 22:23:14 +03:00

[2.0] Fixed commit order calculation.

This commit is contained in:
romanb 2009-10-28 11:00:17 +00:00
parent 4fc1781d78
commit ce6905cc5d

View File

@ -806,10 +806,8 @@ class UnitOfWork implements PropertyChangedListener
// See if there are any new classes in the changeset, that are not in the
// commit order graph yet (dont have a node).
$newNodes = array();
$classesInChangeSet = array();
foreach ($entityChangeSet as $oid => $entity) {
$className = get_class($entity);
$classesInChangeSet[$className] = true;
$className = get_class($entity);
if ( ! $this->_commitOrderCalculator->hasClass($className)) {
$class = $this->_em->getClassMetadata($className);
$this->_commitOrderCalculator->addClass($class);
@ -820,7 +818,7 @@ class UnitOfWork implements PropertyChangedListener
// Calculate dependencies for new nodes
foreach ($newNodes as $class) {
foreach ($class->associationMappings as $assoc) {
if ($assoc->isOwningSide && $assoc->isOneToOne() && isset($classesInChangeSet[$assoc->targetEntityName])) {
if ($assoc->isOwningSide && $assoc->isOneToOne()) {
$targetClass = $this->_em->getClassMetadata($assoc->targetEntityName);
if ( ! $this->_commitOrderCalculator->hasClass($targetClass->name)) {
$this->_commitOrderCalculator->addClass($targetClass);