1
0
mirror of https://github.com/fzaninotto/Faker.git synced 2025-03-28 19:22:35 +01:00

Temporary solution which allow to call method on entity with 1 parameter

* this will be solved later with arbitrary number of parameters
This commit is contained in:
Miloslav Nenadal 2013-01-25 15:40:42 +01:00
parent 9d7bf61772
commit 6d051d4c6c

@ -94,9 +94,13 @@ class EntityPopulator
foreach ($this->columnFormatters as $field => $format) {
if (null !== $format) {
$value = is_callable($format) ? $format($insertedEntities, $obj) : $format;
if (is_callable(array($obj, $field))) {
$obj->$field($value);
} else {
$this->class->reflFields[$field]->setValue($obj, $value);
}
}
}
$manager->persist($obj);