Field attributes setter

@param FieldView $field
@return $this
484303
public function attributes(FieldView $field)
    {
        if (is_null($field)) {
            return $this;
        }

        if (!is_null($field->label)) {
            $this->attributes['label'] = $field->label;
        }
        if (!is_null($field->description)) {
            $this->attributes['help'] = $field->description;
        }

        if (!is_null($field->placeholder)) {
            array_set($this->attributes, 'attributes.placeholder', $field->placeholder);
        }

        if (!empty($field->additional_attributes)) {
            $attrs                = explode(';', $field->additional_attributes);
            $additionalAttributes = [];
            array_map(function($element) use(&$additionalAttributes) {
                @list($name, $value) = explode(':', $element);
                $additionalAttributes[$name] = $value;
            }, $attrs);
            array_set($this->attributes, 'attributes', array_merge($this->attributes['attributes'], $additionalAttributes));
        }

        $this->id                 = $this->id ?? $field->name;
        $this->name               = $this->name ?? $field->name;
        $this->type               = $this->type ?? $field->type_name . (($field->type) ? ':' . $field->type : '');
        $this->value              = $this->value ?? $field->value;
        $this->attributes['name'] = $field->name;
        if ($field->option_values && !isset($this->attributes['options'])) {
            $options = explode(';', $field->option_values);
            foreach ($options as $option) {
                @list($value, $label) = explode(':', $option);
                $this->attributes['options'][$value] = $label;
            }
        }
        if (is_null($this->field)) {
            $this->field = $field;
        }

        $validatorOptions = explode(';', $field->validators_config);
        $options          = [];
        foreach ($validatorOptions as $option) {
            @list($id, $value) = explode(':', $option);
            array_set($options, $id, $value);
        }
        $validators = explode(';', $field->validators);
        $config     = [];
        foreach ($validators as $validator) {
            @list($id, $name) = explode(':', $validator);
            if ($name == 'custom') {
                continue;
            }
            if (isset($options[$id])) {
                $name = $name . ':' . $options[$id];
            }
            array_set($config, $id, $name);
        }

        if (!isset($this->rules[$this->name])) {
            $this->rules[$this->name] = [];
        }
        $this->rules[$this->name] = array_unique(array_merge($this->rules[$this->name], $config));

        return $this;
    }
100809
protected function initializeField($field)
    {
        $field->setParentContext($this);
        $this->getFieldManager()->pushField($field);
        return $field;
    }
519001
public function remove($field)
    {
        if (! is_array($field)) {
            $field = func_get_args();
        }

        foreach ($field as $f) {
            $this->update('$unset', $f, 1);
        }

        return $this;
    }
393402
public function addField(string $field, string $value): self
    {
        $this->fields[$field] = $value;

        return $this;
    }
111292
public function build_field($field)
	{
		! $field instanceof Fieldset_Field && $field = $this->field($field);

		return $field->build();
	}
509971
protected function setFields()
    {
        $this->tableFields = new \stdClass();
        foreach ($this->schema() as $field => $type)
            $this->tableFields->{$field} = (Validate::isNumeric($type) and $field != $this->databaseConfig->getIdentifier()) ? 0 : null;
        $this->clearIdentifier();
        return $this;            
    }
182495
public function addField(Field $field, $key = null)
    {
        $this->fields[$key] = $field;

        return $this;
    }
546920
protected function fileField(Field $field) : FileFieldBuilder
    {
        return $field->image()->attrs($this->getAll([
            self::ATTR_MIN_WIDTH,
            self::ATTR_MAX_WIDTH,
            self::ATTR_MIN_HEIGHT,
            self::ATTR_MAX_HEIGHT,
        ]));
    }
1002272
public function setFields(array $fields)
    {
        $this->clearFields();

        foreach ($fields as $field) {
            $this->addField($field);
        }

        return $this;
    }
536359
protected function setLabel(Field & $field, $name)
    {
        $field->addLabel($this->getLabelName($name), $this->tableName, true, $this->locale);

        return $this;
    }
818935
protected function addFieldDefaultValue(&$property, Field $field)
    {
        if (!is_null($field->dataValue) && !$field->nullable) {
            $property .= sprintf("->default('%s')", $field->dataValue);
        }

        return $this;
    }
136657
public function setFieldList($field_list = array())
    {
        if (empty($field_list)) $this->_field_list = array('*');
        $this->_field_list = (array)$field_list;

        return $this;
    }
389533
public function indexBy($field)
    {
        $elements = $this->toArray();
        $this->clear();

        foreach ($elements as $element) {
            $this->set(
                $this->getFieldValue($element, $field),
                $element
            );
        }

        return $this;
    }
404197
public function addField(FieldInterface $field)
    {
        $this->fields[] = $field;
        $field->setContentType($this);

        return $this;
    }
817963
public function setField(string $field, string $value)
        {
                return $this->_redis->hset($this->_key, $field, $value);
        }
1232189
public function flipBoolValue($field)
    {
        $this->setField($field, (int)!$this->getField($field));

        return $this;
    }
1012310
public function field(string $field) : self
    {
        $this->currentField = $field;
        $this->expr->field($field);

        return $this;
    }