Changeset 7392
- Timestamp:
- 02/07/08 18:52:17 (10 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfPropelImpersonatorPlugin/trunk/lib/sfPropelObjectPeerImpersonator.class.php
r7391 r7392 163 163 'type' => self::RELATION_I18N, 164 164 'classTo' => $_class_to, 165 'classFrom' => $_class_from,165 'classFrom' => $_class_from, 166 166 'local' => $c->getPhpName(), 167 167 'distant' => $c->getRelatedTableName(), … … 394 394 if ($index/*&&$isNewObject*/) 395 395 { 396 $linkedRelationsCounter = 0; 397 396 398 foreach ($this->getRelationsFor($index) as $relation) 397 399 { … … 424 426 $currentObject->{'add'.$foreignClass}($foreignObject); 425 427 $foreignObject->{'set'.$relation['classTo']}($currentObject); 428 429 $linkedRelationsCounter++; 426 430 break; 427 431 … … 448 452 $object->{'set'.$relation['classTo'].'I18nForCulture'}($i18nObject, $this->getCulture()); 449 453 454 $linkedRelationsCounter++; 450 455 } 451 456 break; … … 477 482 $foreignObject->{'init'.$relation['classFrom'].'s'}($rowObjects[$index]); 478 483 $foreignObject->{'add'.$relation['classFrom']}($rowObjects[$index]); 479 } 484 485 $linkedRelationsCounter++; 486 } 487 break; 488 489 case self::RELATION_SELF: 490 throw new sfException('Self relations not yet implemented'); 480 491 break; 481 492 } … … 486 497 } 487 498 } 499 500 if (!$linkedRelationsCounter) 501 { 502 // this should not happen. An object which is not our main object has not been linked to any other 503 // fetched object. 504 throw new sfException('Orphan object fetched of type '.get_class($rowObjects[$index])); 505 } 488 506 } 489 507