public function finishView(FormView $view, FormInterface $form, array $options)
    {
        $data = $this->context->getCurrentNodeId();

        if (!$view->parent && $options['compound'] and !empty($data)) {
            $factory = $form->getConfig()->getFormFactory();

            $form = $factory->createNamed($options['node_id_field_name'], 'hidden', $data, ['mapped' => false]);

            $view->children[$options['node_id_field_name']] = $form->createView($view);
        }
    }
public function finishView(FormView $view, FormInterface $form, array $options)
    {
        $data = $this->context->getCurrentNodeId();

        if (!$view->parent && $options['compound'] and !empty($data)) {
            $factory = $form->getConfig()->getFormFactory();

            $form = $factory->createNamed($options['node_id_field_name'], 'hidden', $data, ['mapped' => false]);

            $view->children[$options['node_id_field_name']] = $form->createView($view);
        }
    }
public function finishView ( FormView $ view , FormInterface $ form , array $ options ) { $ data = $ this -> context -> getCurrentNodeId ( ) ; if ( ! $ view -> parent && $ options [ 'compound' ] and ! empty ( $ data ) ) { $ factory = $ form -> getConfig ( ) -> getFormFactory ( ) ; $ form = $ factory -> createNamed ( $ options [ 'node_id_field_name' ] , 'hidden' , $ data , [ 'mapped' => false ] ) ; $ view -> children [ $ options [ 'node_id_field_name' ] ] = $ form -> createView ( $ view ) ; } }
Adds a Node ID field to the root form view.

@param FormView      $view    The form view
@param FormInterface $form    The form
@param array         $options The options
Adds a Node ID field to the root form view .