[Form] Improved the way passed data is handled in FormFactory

This commit is contained in:
Bernhard Schussek 2011-04-24 13:32:29 +02:00
parent 335f7e776a
commit d58c610833

View File

@ -123,6 +123,10 @@ class FormFactory implements FormFactoryInterface
$knownOptions = array();
$passedOptions = array_keys($options);
if (!array_key_exists('data', $options)) {
$options['data'] = $data;
}
while (null !== $type) {
$type = $this->getType($type);
@ -160,10 +164,6 @@ class FormFactory implements FormFactoryInterface
}
}
if (null !== $data) {
$builder->setData($data);
}
return $builder;
}