From 89276b09b770e2a4b9095323b22e5debb0c73405 Mon Sep 17 00:00:00 2001 From: Adrien SAMSON Date: Fri, 18 Jan 2013 15:21:51 +0100 Subject: [PATCH] Add support for collection type in FormType Parser --- Parser/FormTypeParser.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Parser/FormTypeParser.php b/Parser/FormTypeParser.php index 25a73bd..b722c1e 100644 --- a/Parser/FormTypeParser.php +++ b/Parser/FormTypeParser.php @@ -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')]); } }