diff --git a/src/Faker/ORM/Doctrine/EntityPopulator.php b/src/Faker/ORM/Doctrine/EntityPopulator.php index 126f3247..0949df36 100644 --- a/src/Faker/ORM/Doctrine/EntityPopulator.php +++ b/src/Faker/ORM/Doctrine/EntityPopulator.php @@ -94,7 +94,11 @@ class EntityPopulator foreach ($this->columnFormatters as $field => $format) { if (null !== $format) { $value = is_callable($format) ? $format($insertedEntities, $obj) : $format; - $this->class->reflFields[$field]->setValue($obj, $value); + if (is_callable(array($obj, $field))) { + $obj->$field($value); + } else { + $this->class->reflFields[$field]->setValue($obj, $value); + } } }