Merge pull request #129 from adriensamson/collection-form

Add support for collection type in FormType Parser
This commit is contained in:
William DURAND 2013-03-16 18:54:48 +01:00
commit 04a6292eca

View File

@ -90,6 +90,8 @@ class FormTypeParser implements ParserInterface
for ($type = $config->getType(); null !== $type; $type = $type->getParent()) {
if (isset($this->mapTypes[$type->getName()])) {
$bestType = $this->mapTypes[$type->getName()];
} elseif ('collection' === $type->getName() && isset($this->mapTypes[$config->getOption('type')])) {
$bestType = sprintf('array of %ss', $this->mapTypes[$config->getOption('type')]);
}
}