コード例 #1
0
ファイル: Form.php プロジェクト: rudott/symfony
 /**
  * Adds a child to the form.
  *
  * @param FormInterface $child The FormInterface to add as a child
  *
  * @return Form the current form
  */
 public function add(FormInterface $child)
 {
     $this->children[$child->getName()] = $child;
     $child->setParent($this);
     if ($this->dataMapper) {
         $this->dataMapper->mapDataToForm($this->getClientData(), $child);
     }
     return $this;
 }
コード例 #2
0
ファイル: Form.php プロジェクト: nicodmf/symfony
 /**
  * Adds a child to the form.
  *
  * @param FormInterface $child The FormInterface to add as a child
  *
  * @return Form the current form
  */
 public function add(FormInterface $child)
 {
     if ($this->bound) {
         throw new AlreadyBoundException('You cannot add children to a bound form');
     }
     $this->children[$child->getName()] = $child;
     $child->setParent($this);
     if ($this->dataMapper) {
         $this->dataMapper->mapDataToForm($this->getClientData(), $child);
     }
     return $this;
 }