@param       $field
@param array $field_extend

@return Toggler
548944
function toggle($field, $field_extend = []) {
        $toggler = new Toggler();
        $toggler->setState($this->model->{$field})
                ->setLabel($this->model->getEntityLabel($field))
                ->setAttribute('data-action', 'toggle')
                ->setAttribute('data-field', $field)
                ->setAttribute('data-field-extend', http_build_query($field_extend));

        return $toggler;
    }
1366958
public function castingHelper($field)
    {
        $copy = $this->CopyContentFrom();
        if ($copy && $copy->exists() && ($helper = $copy->castingHelper($field))) {
            return $helper;
        }
        return parent::castingHelper($field);
    }
42823
public function addField(Field $field, Key $key = null)
    {
        if (null !== $key) {
            $field->setKey($key);
        }
        
        $this->fields[$field->getName()] = $field;

        return $this;
    }
189727
public static function createFromField(Field $field): self
    {
        $message = new self();
        $message->setId($field->getId());
        $message->setToken($field->getToken());
        $message->setDescription($field->getDescription());

        foreach ($field->getTranslations() as $translation) {
            $transMessage = FieldTranslationMessage::createFromFieldTranslation($translation);

            $message->addTranslation($transMessage);
        }

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

        return $this;
    }
88565
public function allowField($field)
    {
        if (is_string($field)) {
            $field = explode(',', $field);
        }

        $this->field = $field;

        return $this;
    }
141645
public function assertEnabled($field)
    {
        $element = $this->resolver->resolveForField($field);

        PHPUnit::assertTrue(
            $element->isEnabled(),
            "Expected element [{$field}] to be enabled, but it wasn't."
        );

        return $this;
    }
211801
public function removeField($field)
    {
        foreach ($this->fieldsets as $fieldset) {
            if ($fieldset->hasField($field)) {
                unset($fieldset[$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;
    }
111292
public function build_field($field)
	{
		! $field instanceof Fieldset_Field && $field = $this->field($field);

		return $field->build();
	}
1036416
public function setFieldType($field, Type $type) {
    $this->types->set($this->getKey($field), $type);
    return $this;
  }
1201110
public function addField(Field $field)
    {
        $field
            ->setSection($this->currentSection)
            ->setOptionName($this->registry['option_name'])
        ;

        if (isset($this->registry['field_values'][$field->getId()])) {
            $field->setValue($this->registry['field_values'][$field->getId()]);
        }

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

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

        return $this;
    }
386727
public function parent($field = 'parent', callable $callback = null)
    {
        $this->addSelfReferencingRelation($field, $callback);

        $this->parent = $field;

        return $this;
    }
1283352
private function cloneField(Field $field, array $overrides = [])
    {
        $fieldData = array_merge(
            [
                'id' => $field->id,
                'value' => $field->value,
                'languageCode' => $field->languageCode,
                'fieldDefIdentifier' => $field->fieldDefIdentifier,
                'fieldTypeIdentifier' => $field->fieldTypeIdentifier,
            ],
            $overrides
        );

        return new Field($fieldData);
    }
1199956
public function canMap(Field $field)
    {
        return
            $field->type instanceof FieldType\MultipleStringField ||
            $field->type instanceof FieldType\TextField ||
            $field->type instanceof FieldType\FullTextField;
    }
466850
public function eq($field, $value) {
        if (is_array($value)) {
            $this->in($field, $value);

        } else if ($value === null) {
            $this->null($field);

        } else {
            $this->add($field, '=', $value);
        }

        return $this;
    }