@param Field $field

@return FileFieldBuilder
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,
        ]));
    }
100809
protected function initializeField($field)
    {
        $field->setParentContext($this);
        $this->getFieldManager()->pushField($field);
        return $field;
    }
860925
protected function createFileProperty(IObject $object, FileField $field)
    {
        $property = $this->getPrototype(
            $this->defaultFilePropertyClass,
            ['umi\orm\object\property\file\IFileProperty']
        )
            ->createInstance([$object, $field]);

        return $property;
    }
1191986
private function createFieldDefinition(FieldDefinitionObject $field)
    {
        $definition = $this->contentTypeService->newFieldDefinitionCreateStruct($field->data['identifier'], $field->data['type']);
        $field->getMapper()->mapObjectToCreateStruct($definition);

        return $definition;
    }
728136
public function file($field, $label) {
        $file = new File($this->_entity, $field, $label);
        array_push($this->_elements, $file);

        return $file;
    }
471661
public static function where($field)
    {
        $root = new Node(Node::TYPE_CROTCH, Node::OPERATOR_BLANK);
        $criteria = new Criteria($field, $root);
        $root->append(Node::OPERATOR_BLANK, $criteria);

        return $criteria;
    }
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;
    }
791362
public function importField($field)
    {
        $field = $this->model->hasElement($field);
        if (!$field) {
            return;
        }
        /** @type Field $field */

        $field_name = $field->short_name;

        if ($field instanceof Field_Reference) {
            $field_name = $field->getDereferenced();
        }

        $field_type = $this->getFieldType($field);

        /** @type string $field_caption */
        $field_caption = $field->caption();

        $this->field_associations[$field_name] = $field;

        $column = $this->owner->addColumn($field_type, $field_name, $field_caption);

        if ($field->sortable() && $column->hasMethod('makeSortable')) {
            $column->makeSortable();
        }

        return $column;
    }
758526
public function getFileList($field = null)
    {
        $dir = $this->getFilePath($field, '');
        if (!file_exists($dir) || !is_dir($dir)) {
            return [];
        }
        return array_diff(scandir($dir), ['.', '..']);
    }
157654
private function buildWildcard($field)
    {
        return $this::$open.$field.Operator::$equals.Operator::$wildcard.$this::$close;
    }
207549
public function addField(Field $field)
    {
        if (!isset($this->attachment['fields'])) {
            $this->attachment['fields'] = [];
        }

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

        return $this;
    }
738977
public static function getAdded(Field $field)
    {
        $change = new FieldMigrationChange();
        $change->field = $field;
        $change->isAdded = true;

        return $change;
    }
1068834
public function getUploadFieldName($field = null)
    {
        if (!is_null($field)) {
            return $field;
        }

        $imagesFields = $this->getDefinedUploadFields();
        $fieldKey = array_first(array_keys($imagesFields));

        // return first field name
        return is_int($fieldKey)
            ? $imagesFields[$fieldKey]
            : $fieldKey;
    }
814440
public function addField($field)
    {
        if (! is_array($field) && ! $field instanceof AttachmentField) {
            throw FieldCannotBeAdded::invalidType();
        }

        if (is_array($field)) {
            $title = array_keys($field)[0];
            $value = $field[$title];

            $field = AttachmentField::create($title, $value);
        }

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

        return $this;
    }
448077
public function addField(AttachmentField $field)
    {
        if (!isset($this->data['fields'])) {
            $this->data['fields'] = [];
        }

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

        return $this;
    }
655940
public function run($fileField, $type = "upload")
    {
        $this->fileField = $fileField;
        if ($type == "remote") {
            $this->saveRemote();
        } else if ($type == "base64") {
            $this->upBase64();
        } else {
            $this->upFile();
        }
       return $this->getFileInfo();
    }
1028741
public function createCustomField(Field $field)
		{
			$form_data = array(
				'fieldname' => $field->getName(),
				'fieldtype' => $field->getType(),
				'description' => $field->getDescription()
			);
			$this->call('customfieldcreate', $form_data);

			return TRUE;
		}