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

Commit

Permalink
Fix for Spot2 ORM EntityPopulator
Browse files Browse the repository at this point in the history
In Spot2 you don't need to create getId methods for your entities and Faker requires from you to have such. Changing it like this will not force developer to create getId methods in Spot2 entity classes.
  • Loading branch information
michal-borek authored Jan 18, 2018
1 parent d15bf1d commit 87b3f95
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 87b3f95

Please sign in to comment.