mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-09 02:59:27 +03:00
Merge pull request #129 from adriensamson/collection-form
Add support for collection type in FormType Parser
This commit is contained in:
commit
04a6292eca
@ -90,6 +90,8 @@ class FormTypeParser implements ParserInterface
|
|||||||
for ($type = $config->getType(); null !== $type; $type = $type->getParent()) {
|
for ($type = $config->getType(); null !== $type; $type = $type->getParent()) {
|
||||||
if (isset($this->mapTypes[$type->getName()])) {
|
if (isset($this->mapTypes[$type->getName()])) {
|
||||||
$bestType = $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')]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user