Changeset 10167
- Timestamp:
- 07/07/08 15:55:31 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfPropelFinderPlugin/lib/sfPropelFinder.php
r10166 r10167 1059 1059 $mapBuilder->doBuild(); 1060 1060 } 1061 if($this->databaseMap->getTable($c->getRelatedTableName())->getPhpName() == $phpName) 1061 try 1062 { 1063 $tableMap = $this->databaseMap->getTable($c->getRelatedTableName()); 1064 } 1065 catch (PropelException $e) 1066 { 1067 // so $c->getRelatedTable() is not in the database map 1068 // even though the $phpName table map has been initialized 1069 // we are obviously looking for the wrong table here 1070 continue; 1071 } 1072 if($tableMap->getPhpName() == $phpName) 1062 1073 { 1063 1074 return array( … … 1066 1077 ); 1067 1078 } 1079 1068 1080 } 1069 1081 } plugins/sfPropelFinderPlugin/test/unit/sfPropelFinderRelationsTest.php
r10133 r10167 79 79 $con = Propel::getConnection(); 80 80 81 $t = new lime_test(7 7, new lime_output_color());81 $t = new lime_test(78, new lime_output_color()); 82 82 83 83 $t->diag('findRelation()'); 84 85 class myFinder extends sfPropelFinder 86 { 87 public function findRelation($arg1, $arg2) 88 { 89 return parent::findRelation($arg1, $arg2); 90 } 91 } 92 $finder = new myFinder('Article'); 93 try 94 { 95 $relation = $finder->findRelation('ArticleI18n', 'ArticlePeer'); 96 $t->pass('findRelation() does not fail to find relationships when the whole database map is not built yet'); 97 } 98 catch(Exception $e) 99 { 100 $t->fail('findRelation() does not fail to find relationships when the whole database map is not built yet'); 101 } 102 84 103 85 104 ClubPeer::doDeleteAll();