Add fully configured form field instance.
@param \MvcCore\Ext\Forms\Field|\MvcCore\Ext\Forms\IField $field
@return \MvcCore\Ext\Form|\MvcCore\Ext\Forms\IForm
355441
public function & AddField (\MvcCore\Ext\Forms\IField $field) {
		/** @var $this \MvcCore\Ext\Forms\IForm */
		/** @var $field \MvcCore\Ext\Forms\Field */
		if ($this->dispatchState < 1) $this->Init();
		$fieldName = $field->GetName();
		$field->SetForm($this);
		$this->fields[$fieldName] = & $field;
		if ($field instanceof \MvcCore\Ext\Forms\Fields\ISubmit) {
			$this->submitFields[$fieldName] = & $field;
			$fieldCustomResultState = $field->GetCustomResultState();
			if ($fieldCustomResultState !== NULL)
				$this->customResultStates[$fieldName] = $fieldCustomResultState;
		}
		return $this;
	}
1221391
public function &addField(FieldInterface $field)
    {
        if (empty($this->fields[$field->getName()])) {
            $this->fields[$field->getName()] = $field;
            $field->onAddedToType($this); // Let the field register indexes, custom behaviour etc
        } else {
            throw new InvalidArgumentException("Field '" . $field->getName() . "' already exists in this type");
        }

        return $this;
    }
1045213
public function add(FormField $field) {
		if($this->owner->hasTabSet()) {
			$before = ($this->tab == "Main" && $this->owner->dataFieldByName("Content")) ? "Content" : null;
			$this->owner->addFieldToTab("Root.{$this->tab}",$field, $before);
		}
		else {
			$this->owner->push($field);
		}
	}
193503
public static function forField(IField $field) : ColumnComponentType
    {
        return new self(
                $field->getProcessedType(),
                StandardConditions::forField($field, $field->getProcessedType()->getConditionOperators())
        );
    }
1029773
protected function assignField(FieldInterface $field)
    {
        if ($field->mapping() !== null) {
            $this->builder->addSelect(
                sprintf(
                    '%s AS %s',
                    $this->connection->quoteIdentifier($field->mapping()),
                    $this->connection->quoteIdentifier($field->name())
                )
            );
        } else {
            $this->builder->addSelect($this->connection->quoteIdentifier($field->name()));
        }

        $this->casts[$field->name()] = $field->type();
    }
384221
public function addField(DatabaseField $field)
    {
        $name = $field->getName();
        $this->m_fields[$name] = $field; # we key by name to prevent duplicates!
    }
1353191
public function like($field, $value) {
        $this->add($field, Expr::LIKE, $value);

        return $this;
    }
1123178
public function setField($field)
    {
        if(is_string($field)) {
            $field = new FieldIdentifier($field);
        }
        $this->field = $field;
        return $this;
    }
477523
public function form(IForm $form) : InnerFormFieldBuilder
    {
        if ($form instanceof FormObject) {
            return new InnerFormObjectFieldBuilder($this->type(new InnerFormObjectType($form))->value($form));
        }

        return new InnerFormFieldBuilder($this->type(new InnerFormType($form))->value($form->getInitialValues()));
    }
464023
public function bindTo(IFieldAccessor $accessor) : FormFieldBindingDefinition
    {
        return new FormFieldBindingDefinition($this->field, new FieldBinding($this->field->getName(), $accessor));
    }
393402
public function addField(string $field, string $value): self
    {
        $this->fields[$field] = $value;

        return $this;
    }
1179115
public function pushField(Field $field)
    {
        $field->setForm($this);

        $this->builder->fields()->push($field);

        return $this;
    }
723155
public function addField(Field $field)
    {
        if (array_search($field, $this->fields) === false)
            $this->fields[] = $field;
    }
1087683
protected function FindSnippet(IFormField $field)
    {
        if ($field instanceof Input && 
                ($field->GetType() == Input::TypeText || 
                $field->GetType() == Input::TypePassword ||
                $field->GetType() == Input::TypeColor))
        {
            return new FormFields\TextInputField($field);
        }
        
        if ($field instanceof Input && 
                $field->GetType() == Input::TypeHidden)
        {
            return new FormFields\HiddenInputField($field);
        }
        
        if ($field instanceof Input && 
                $field->GetType() == Input::TypeFile)
        {
            return new FormFields\FileInputField($field);
        }
        if ($field instanceof Custom)
        {
            return new FormFields\CustomField($field);
        }
        if ($field instanceof Select)
        {
            return new FormFields\SelectField($field);
        }
        
        if ($field instanceof Textarea)
        {
            return new FormFields\TextareaField($field);
        }
        
        if ($field instanceof Checkbox)
        {
            return new FormFields\CheckboxField($field);
        }
        
        if ($field instanceof CheckList)
        {
            return new FormFields\CheckListField($field);
        }
        
        if ($field instanceof Submit)
        {
            return new FormFields\SubmitField($field);
        }
        
        if ($field instanceof Radio) {
            return new FormFields\RadioField($field);
        }
    }
1185017
protected function makeFormFieldWidget($field)
    {
        if ($field->type !== 'widget') {
            return null;
        }

        if (isset($this->formWidgets[$field->fieldName])) {
            return $this->formWidgets[$field->fieldName];
        }

        $widgetConfig = $this->makeConfig($field->config);
        $widgetConfig->alias = $this->alias . studly_case(HtmlHelper::nameToId($field->fieldName));
        $widgetConfig->sessionKey = $this->getSessionKey();
        $widgetConfig->previewMode = $this->previewMode;
        $widgetConfig->model = $this->model;
        $widgetConfig->data = $this->data;
        $widgetConfig->parentForm = $this;

        $widgetName = $widgetConfig->widget;
        $widgetClass = $this->widgetManager->resolveFormWidget($widgetName);

        if (!class_exists($widgetClass)) {
            throw new ApplicationException(Lang::get(
                'backend::lang.widget.not_registered',
                ['name' => $widgetClass]
            ));
        }

        $widget = $this->makeFormWidget($widgetClass, $field, $widgetConfig);

        /*
         * If options config is defined, request options from the model.
         */
        if (isset($field->config['options'])) {
            $field->options(function () use ($field) {
                $fieldOptions = $field->config['options'];
                if ($fieldOptions === true) $fieldOptions = null;
                $fieldOptions = $this->getOptionsFromModel($field, $fieldOptions);
                return $fieldOptions;
            });
        }

        return $this->formWidgets[$field->fieldName] = $widget;
    }
935938
protected function createCommonProperty(IObject $object, IField $field)
    {
        $property = $this->getPrototype(
            $this->defaultPropertyClass,
            ['umi\orm\object\property\IProperty']
        )
        ->createInstance([$object, $field]);

        return $property;
    }
1160011
public function addField($field, $fieldset = null, $group = null)
    {
        return $this->form->addField($field, $fieldset, $group);
    }