Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1408 from michal-borek/patch-1
Browse files Browse the repository at this point in the history
Fix for Spot2 ORM EntityPopulator
  • Loading branch information
fzaninotto authored Jan 25, 2018
2 parents 55c1fcb + 87b3f95 commit ab1549f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Faker/ORM/Spot/EntityPopulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function guessColumnFormatters(Generator $generator)

$formatters[$fieldName] = function ($inserted) use ($required, $entityName, $locator) {
if (!empty($inserted[$entityName])) {
return $inserted[$entityName][mt_rand(0, count($inserted[$entityName]) - 1)]->getId();
return $inserted[$entityName][mt_rand(0, count($inserted[$entityName]) - 1)]->get('id');
}

if ($required && $this->useExistingData) {
Expand Down

0 comments on commit ab1549f

Please sign in to comment.