Skip to content

Commit

Permalink
Add support for collection type in FormType Parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrien SAMSON committed Jan 18, 2013
1 parent c946fbc commit 89276b0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Parser/FormTypeParser.php
Expand Up @@ -90,6 +90,8 @@ private function parseForm($form, $prefix = null)
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')]);
}
}

Expand Down

0 comments on commit 89276b0

Please sign in to comment.