1
0
mirror of https://github.com/fzaninotto/Faker.git synced 2025-03-22 00:09:59 +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

View File

@ -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);
}
}
}