Commit ce6905cc authored by romanb's avatar romanb

[2.0] Fixed commit order calculation.

parent 4fc1781d
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment