code: public function setFormField($value)
      {
          if (is_array($value)) {
              if (is_null($this->formFieldClass)) {
                  throw new Exception("DB Field incorrectly set up. What is the form class?");
              }
              if (is_null($this->_formField)) {
                  $config = $value;
                  $config['class'] = $this->formFieldClass;
                  $config['modelField'] = $this;
                  $value = Yii::createObject($config);
              } else {
                  $settings = $value;
                  $value = $this->_formField;
                  unset($settings['class']);
                  Yii::configure($value, $settings);
              }
          }
  
          $this->_formField = $value;
  
          return true;
      }
docs: Set form field.
  
  @param [[@doctodo param_type:value]] $value [[@doctodo param_description:value]]
  
  @throws Exception [[@doctodo exception_description:Exception]]
  @return [[@doctodo return_type:setFormField]] [[@doctodo return_description:setFormField]]