mirror of
https://github.com/fzaninotto/Faker.git
synced 2025-03-22 00:09:59 +01:00
Fixed bug with relations using namespaces
This commit is contained in:
parent
0051acd04e
commit
97ca6c169a
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user