original_string: public function addField($objField)
      {
          if (get_class($objField) == "ValidFormBuilder\\Fieldset") {
              $objField->setMeta("parent", $this, true);
              $this->__elements->addObject($objField);
          } else {
              if ($this->__elements->count() == 0) {
                  $objFieldset = new Fieldset();
                  $this->__elements->addObject($objFieldset);
              }
  
              $objFieldset = $this->__elements->getLast();
  
              $objField->setMeta("parent", $objFieldset, true);
              $objFieldset->getFields()->addObject($objField);
  
              if ($objField->isDynamic() && get_class($objField) !== "ValidFormBuilder\\MultiField"
                      && get_class($objField) !== "ValidFormBuilder\\Area") {
                  $objHidden = new Hidden($objField->getId() . "_dynamic", ValidForm::VFORM_INTEGER, array(
                      "default" => 0,
                      "dynamicCounter" => true
                  ));
  
                  $objFieldset->addField($objHidden);
  
                  $objField->setDynamicCounter($objHidden);
              }
          }
      }
code: public function addField($objField)
      {
          if (get_class($objField) == "ValidFormBuilder\\Fieldset") {
              $objField->setMeta("parent", $this, true);
              $this->__elements->addObject($objField);
          } else {
              if ($this->__elements->count() == 0) {
                  $objFieldset = new Fieldset();
                  $this->__elements->addObject($objFieldset);
              }
  
              $objFieldset = $this->__elements->getLast();
  
              $objField->setMeta("parent", $objFieldset, true);
              $objFieldset->getFields()->addObject($objField);
  
              if ($objField->isDynamic() && get_class($objField) !== "ValidFormBuilder\\MultiField"
                      && get_class($objField) !== "ValidFormBuilder\\Area") {
                  $objHidden = new Hidden($objField->getId() . "_dynamic", ValidForm::VFORM_INTEGER, array(
                      "default" => 0,
                      "dynamicCounter" => true
                  ));
  
                  $objFieldset->addField($objHidden);
  
                  $objField->setDynamicCounter($objHidden);
              }
          }
      }
code_tokens: public function addField ( $ objField ) { if ( get_class ( $ objField ) == "ValidFormBuilder\\Fieldset" ) { $ objField -> setMeta ( "parent" , $ this , true ) ; $ this -> __elements -> addObject ( $ objField ) ; } else { if ( $ this -> __elements -> count ( ) == 0 ) { $ objFieldset = new Fieldset ( ) ; $ this -> __elements -> addObject ( $ objFieldset ) ; } $ objFieldset = $ this -> __elements -> getLast ( ) ; $ objField -> setMeta ( "parent" , $ objFieldset , true ) ; $ objFieldset -> getFields ( ) -> addObject ( $ objField ) ; if ( $ objField -> isDynamic ( ) && get_class ( $ objField ) !== "ValidFormBuilder\\MultiField" && get_class ( $ objField ) !== "ValidFormBuilder\\Area" ) { $ objHidden = new Hidden ( $ objField -> getId ( ) . "_dynamic" , ValidForm :: VFORM_INTEGER , array ( "default" => 0 , "dynamicCounter" => true ) ) ; $ objFieldset -> addField ( $ objHidden ) ; $ objField -> setDynamicCounter ( $ objHidden ) ; } } }
docstring: Add a field object
  
  See {@link \ValidFormBuilder\Fieldset::addField()}
  
  @param Element $objField
docstring_tokens: Add a field object