diff --git a/src/Faker/ORM/Propel/EntityPopulator.php b/src/Faker/ORM/Propel/EntityPopulator.php index 0b7d24bc..00843657 100644 --- a/src/Faker/ORM/Propel/EntityPopulator.php +++ b/src/Faker/ORM/Propel/EntityPopulator.php @@ -50,7 +50,7 @@ class EntityPopulator $columnTypeGuesser = new \Faker\ORM\Propel\ColumnTypeGuesser($generator); foreach ($tableMap->getColumns() as $columnMap) { if ($columnMap->isForeignKey()) { - $relatedClass = $columnMap->getRelation()->getForeignTable()->getPhpName(); + $relatedClass = $columnMap->getRelation()->getForeignTable()->getClassname(); $formatters[$columnMap->getPhpName()] = function($inserted) use($relatedClass) { return isset($inserted[$relatedClass]) ? $inserted[$relatedClass][mt_rand(0, count($inserted[$relatedClass]) - 1)] : null; }; continue; }