public function onPreSetData(FormEvent $event)
    {
        $form = $event->getForm();
        $item = $event->getData();

        foreach ($this->fields as $field) {
            list ($name, $type, $options) = $field;
            if (null !== $item) {
                $options = array_replace($options, $this->itemHelper->getFormOptions($item, $name));
            }
            $form->add($name, $type, $options);
        }
    }
public function onPreSetData(FormEvent $event)
    {
        $form = $event->getForm();
        $item = $event->getData();

        foreach ($this->fields as $field) {
            list ($name, $type, $options) = $field;
            if (null !== $item) {
                $options = array_replace($options, $this->itemHelper->getFormOptions($item, $name));
            }
            $form->add($name, $type, $options);
        }
    }
public function onPreSetData ( FormEvent $ event ) { $ form = $ event -> getForm ( ) ; $ item = $ event -> getData ( ) ; foreach ( $ this -> fields as $ field ) { list ( $ name , $ type , $ options ) = $ field ; if ( null !== $ item ) { $ options = array_replace ( $ options , $ this -> itemHelper -> getFormOptions ( $ item , $ name ) ) ; } $ form -> add ( $ name , $ type , $ options ) ; } }
Form pre set data event handler.

@param FormEvent $event
Form pre set data event handler .