Add support for collection type in FormType Parser

This commit is contained in:
Adrien SAMSON 2013-01-18 15:21:51 +01:00
parent c946fbcf4f
commit 89276b09b7

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')]);
}
}