Sets the parent form.
public setParent ( Symfony\Component\Form\FormInterface $parent = null ) : |
||
$parent | Symfony\Component\Form\FormInterface | The parent form |
Résultat | The current form |
/** * @param string $name * @param string $dataClass * @param array $options * @param FormInterface $parent * @return FormInterface */ protected function createForm($name, $dataClass = null, array $options = array(), FormInterface $parent = null) { $eventDispatcher = $this->getMock('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface'); $config = new FormConfigBuilder($name, $dataClass, $eventDispatcher, $options); $result = new Form($config); $result->setParent($parent); return $result; }
public function testMultipartFormsWithParentsRequireNoFiles() { $form = new Form('author', new Author(), $this->validator); $form->add($this->createMultipartMockField('file')); $form->setParent($this->createMockField('group')); // files are expected to be converted by the parent $form->bind(array('file' => 'test.txt')); }