Symfony\Component\Form\FormBuilder::setParent PHP Méthode

setParent() public méthode

public setParent ( Symfony\Component\Form\FormBuilderInterface $parent = null )
$parent Symfony\Component\Form\FormBuilderInterface
    public function setParent(FormBuilderInterface $parent = null)
    {
        if ($this->locked) {
            throw new FormException('The form builder cannot be modified anymore.');
        }

        $this->parent = $parent;

        return $this;
    }

Usage Example

 /**
  * {@inheritdoc}
  */
 public function createBuilder(FormFactoryInterface $factory, $name, array $options = array(), FormBuilderInterface $parent = null)
 {
     $options = $this->getOptionsResolver()->resolve($options);
     // Should be decoupled from the specific option at some point
     $dataClass = isset($options['data_class']) ? $options['data_class'] : null;
     $builder = new FormBuilder($name, $dataClass, new EventDispatcher(), $factory, $options);
     $builder->setType($this);
     $builder->setParent($parent);
     $this->buildForm($builder, $options);
     return $builder;
 }
All Usage Examples Of Symfony\Component\Form\FormBuilder::setParent