Add a field to the form.

@param Field $field
@param string $key

@return $this
182495
public function addField(Field $field, $key = null)
    {
        $this->fields[$key] = $field;

        return $this;
    }
301719
public function removeKey($field)
    {
        if($this->exists($field))
        {
            unset($this->__data[$field]);
            $this->invalidateKeycache();
        }
        return $this;
    }
393402
public function addField(string $field, string $value): self
    {
        $this->fields[$field] = $value;

        return $this;
    }
207549
public function addField(Field $field)
    {
        if (!isset($this->attachment['fields'])) {
            $this->attachment['fields'] = [];
        }

        $this->attachment['fields'][] = $field;

        return $this;
    }
551964
protected function addPostField($key)
    {
        if (property_exists($this, $key)) {
            $this->postFields[$key] = $this->$key;
        }
    }
67924
protected function addFieldType(&$property, Field $field)
    {
        $params = $this->getMethodParamerters($field);
        $property .= sprintf("%s('%s'%s)", $this->getPropertyBase($field->getEloquentDataMethod()), $field->name, $params);

        return $this;
    }
94340
protected function addField(SharpFormField $field)
    {
        $this->fields[] = $field;
        $this->formBuilt = false;

        return $this;
    }
1146291
public function addField(FieldInterface $field)
    {
        $key = $field->getFieldKey();

        $this->addDependsOn($field->getDataModelDependsOn());
        $this->addEffected($key, $field->getDataModelEffecteds());

        $this->_fields[$key] = $field;

        return $this;
    }
928312
public function append($fields)
    {
        if (is_array($fields)) {
            foreach ($fields as $key => $value) {
                $this->column($key, $value);
            }
        } else {
            foreach ($fields->fields() as $name) {
                $this->column($name, $fields->column($name));
            }
        }
        return $this;
    }
1004828
public function push(Field $field){

        $this->offsetSet($field->getName(), $field);

        $numArgs = func_num_args();

        if($numArgs > 1){
            $args = func_get_args();
            for($i=1;$i<$numArgs;$i++){
                $this->push($args[$i]);
            }
        }
        return $this;
    }
527124
protected function addColumn($key, $field, $column)
    {
        if ($this->hasCustomAttribute($column)) {
            return '->' . $field;
        }

        if ($key == 0) {
            return '->' . $field . "('" . $column . "')";
        }

        if (Str::contains($field, '(')) {
            return '->' . $field;
        }

        return '->' . $field . '()';
    }
210048
public function addField(Field $field)
    {
        $tmp               = $this->fields->getValue($this->entity);
        $tmp[$field->name] = $field;
        $this->fields->setValue($this->entity, $tmp);

        if ($field->role == 'id') {
            $key = new \ReflectionProperty(Entity::class, 'key');
            $key->setAccessible(true);
            $key->setValue($this->entity, $field->name);
        }
    }
1123178
public function setField($field)
    {
        if(is_string($field)) {
            $field = new FieldIdentifier($field);
        }
        $this->field = $field;
        return $this;
    }
102138
function create_new_field_keys( &$field )
	{
		// update key
		$field['key'] = 'field_' . uniqid();
		
		
		if( isset($field['sub_fields']) && is_array($field['sub_fields']) )
		{
			foreach( $field['sub_fields'] as $f )
			{
				$this->create_new_field_keys( $f );
			}
		}
		elseif( isset($field['layouts']) && is_array($field['layouts']) )
		{
			foreach( $field['layouts'] as $layout )
			{
				if( isset($layout['sub_fields']) && is_array($layout['sub_fields']) )
				{
					foreach( $layout['sub_fields'] as $f )
					{
						$this->create_new_field_keys( $f );
					}
				}
				
			}
		}
	}
531733
public function addFields($fields)
    {
        $fieldsArr = $this->parseFields($fields);
        !is_array($this->fields) ? $this->fields = [] : null;
        $this->fields = array_unique(ArrayLib::array_add($this->fields, $fieldsArr));
        return $this;
    }
515396
public function append($field, $value)
    {
        $this->resolver->resolveForTyping($field)->sendKeys($value);

        return $this;
    }
1036416
public function setFieldType($field, Type $type) {
    $this->types->set($this->getKey($field), $type);
    return $this;
  }