From 4939d116e08f050446cf60b3d803475a20eef8cd Mon Sep 17 00:00:00 2001 From: ogizanagi Date: Mon, 21 Jul 2014 19:43:39 +0200 Subject: [PATCH] Fix embedded collection of custom FormType Error Fix an error when trying to use embedded form collections. Referenced issue: #442 --- Parser/FormTypeParser.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Parser/FormTypeParser.php b/Parser/FormTypeParser.php index 300ab6e..5359aa9 100644 --- a/Parser/FormTypeParser.php +++ b/Parser/FormTypeParser.php @@ -145,11 +145,11 @@ class FormTypeParser implements ParserInterface $bestType = sprintf('array of %ss', $subType); } else { // Embedded form collection - $type = $config->getOption('type'); - $subForm = $this->formFactory->create($type, null, $config->getOption('options', array())); + $embbededType = $config->getOption('type'); + $subForm = $this->formFactory->create($embbededType, null, $config->getOption('options', array())); $children = $this->parseForm($subForm); $actualType = DataTypes::COLLECTION; - $subType = is_object($type) ? get_class($type) : $type; + $subType = is_object($embbededType) ? get_class($embbededType) : $embbededType; if (class_exists($subType)) { $parts = explode('\\', $subType);