Handler/FormHandler.php
private function process(FormConfigInterface $config, array $objects)
    {
        list($dataList, $objects) = $this->getDataListObjects($config, $objects);
        $forms = [];

        if (\count($objects) !== \count($dataList)) {
            $msg = $this->translator->trans('form_handler.different_size_request_list', [
                '{{ requestSize }}' => \count($dataList),
                '{{ objectSize }}' => \count($objects),
            ], 'FxpResource');

            throw new InvalidResourceException($msg);
        }

        foreach ($objects as $i => $object) {
            $form = $this->formFactory->create($config->getType(), $object, $config->getOptions());

            $form->submit($dataList[$i], $config->getSubmitClearMissing());
            $forms[] = $form;
        }

        return $forms;
    }
private function process(FormConfigInterface $config, array $objects)
    {
        list($dataList, $objects) = $this->getDataListObjects($config, $objects);
        $forms = [];

        if (\count($objects) !== \count($dataList)) {
            $msg = $this->translator->trans('form_handler.different_size_request_list', [
                '{{ requestSize }}' => \count($dataList),
                '{{ objectSize }}' => \count($objects),
            ], 'FxpResource');

            throw new InvalidResourceException($msg);
        }

        foreach ($objects as $i => $object) {
            $form = $this->formFactory->create($config->getType(), $object, $config->getOptions());

            $form->submit($dataList[$i], $config->getSubmitClearMissing());
            $forms[] = $form;
        }

        return $forms;
    }
private function process ( FormConfigInterface $ config , array $ objects ) { list ( $ dataList , $ objects ) = $ this -> getDataListObjects ( $ config , $ objects ) ; $ forms = [ ] ; if ( \ count ( $ objects ) !== \ count ( $ dataList ) ) { $ msg = $ this -> translator -> trans ( 'form_handler.different_size_request_list' , [ '{{ requestSize }}' => \ count ( $ dataList ) , '{{ objectSize }}' => \ count ( $ objects ) , ] , 'FxpResource' ) ; throw new InvalidResourceException ( $ msg ) ; } foreach ( $ objects as $ i => $ object ) { $ form = $ this -> formFactory -> create ( $ config -> getType ( ) , $ object , $ config -> getOptions ( ) ) ; $ form -> submit ( $ dataList [ $ i ] , $ config -> getSubmitClearMissing ( ) ) ; $ forms [ ] = $ form ; } return $ forms ; }
Create the list of form for the object instances.

@param FormConfigInterface $config  The form config
@param array[]|object[]    $objects The list of object instance

@throws InvalidResourceException When the size if request data and the object instances is different

@return FormInterface[]
Create the list of form for the object instances .