Gets array of field after transfering each column meta into field.

@param array $fields

@return array
502969
protected function transfer(array $fields)
    {
        $mappers = array_map(function ($field) {
            return new FieldMapper($field);
        }, $this->getTransfredFields($fields));

        $optimizer = new FieldsOptimizer($mappers);

        return $optimizer->optimize()->getFields();
    }
492762
protected function getFormPlaceholders(array $fields)
    {
        $attributes = [];

        foreach ($fields as $field) {
            /** @var FieldTypeInterface $field */
            $attributes[$field->getName()] = $field->getOption('placeholder');
        }

        return $attributes;
    }
1062067
public function addMetaField(array $fields)
    {
        $fields = parent::addMetaField($fields);
        foreach ($fields as $key => &$field) {
            if ($field['type'] === 'fieldset') {
                $field['fields'][static::Meta] = $fields[static::Meta];
                unset($fields[static::Meta]);
                break;
            }
        }
        return $fields;
    }
580165
public function array_fields($array, array $fields){
        $newArray= array();
        foreach ($array as $value) {
            $newValue= array();
            foreach ($fields as $key) {
                if(array_key_exists($key, $value)){
                    $newValue[$key]= $value[$key];
                }
            }
            $newArray[]= $newValue;
        }        
        return $newArray;
    }
1064618
public function prepareProjection(array $fields) : array
    {
        $preparedFields = [];

        foreach ($fields as $key => $value) {
            $preparedFields[$this->prepareFieldName($key)] = $value;
        }

        return $preparedFields;
    }
20990
public function fields(array $fields)
    {
        $newFields = array();
        $this->fields = '';
        $this->fieldsArguments = array();

        foreach ($fields as $field) {
            if (is_scalar($field)) {
                $newFields[] = '?f:alias:.?f';
                $this->fieldsArguments[] = $field;
            } else {
                if (!isset($field[0]) or !isset($field[1]) or !is_array($field[1])) {
                    throw new \BadMethodCallException('Must be exist 0 and 1 index in array and second one must be an array');
                }
                $newFields[] = $field[0];
                $this->fieldsArguments = array_merge($this->fieldsArguments, $field[1]);
            }
        }

        $this->fields = implode(', ', $newFields);

        return $this;
    }
723864
private function transformColumns($columns)
    {
        return array_map(function ($column) {
            return [
                'Field' => $column->Field,
                'Type' => $column->Type,
                'Null' => $column->Null,
                'Key' => $column->Key,
                'Default' => $column->Default,
                'Extra' => $column->Extra
            ];
        }, $columns);
    }
624307
protected function filterFields(array $fields): array
    {
        if (empty($fields)) {
            return [];
        }

        foreach ($fields as $k => $v) {
            if (false !== strpos($v, $this->table->getAlias() . '.')) {
                continue;
            }

            unset($fields[$k]);
        }

        return $fields;
    }
241477
protected function _getFieldsFromConfig($fields = null) {
		$result = [];
		if (empty($fields)) {
			return $result;
		}

		if (!is_array($fields)) {
			$result = [$fields];
		} else {
			$result = array_keys($fields);
		}

		return $result;
	}
1310533
public function mget(array $fields)
    {
        $result = array();

        foreach ($fields as $field) {
            $result[$field] = $this->get($field);
        }

        return $result;
    }
32560
private function transformColumns($columns)
    {
        return array_map(function ($column) {
            return [
                'Field' => $column->column_name,
                'Type' => $column->data_type,
                'Null' => $column->is_nullable,
                'Key' => $column->ordinal_position,
                'Default' => $column->column_default,
//                'Extra' => $column->Extra
            ];
        }, $columns);
    }
1107401
private function parseFields(array $fields)
    {
        $propertyStub = $this->generateProperty();
        $setterStub   = $this->generateSetter();
        $getterStub   = $this->generateGetter();
        foreach ($fields as $fieldInfo) {
            $this->parseProperty($propertyStub, $fieldInfo);
            $this->parseSetter($setterStub, $fieldInfo);
            $this->parseGetter($getterStub, $fieldInfo);
        }
    }
251603
public function generateFields(array $fields): array
    {
        $traitFqns = [];
        foreach ($fields as list($fieldFqn, $fieldType)) {
            try {
                $traitFqns[] = $this->fieldGenerator->generateField($fieldFqn, $fieldType);
            } catch (\Exception $e) {
                throw new \RuntimeException(
                    'Failed building field with $fieldFqn: ' . $fieldFqn . ' and $fieldType ' . $fieldType,
                    $e->getCode(),
                    $e
                );
            }
        }

        return $traitFqns;
    }
13931
private static function getFieldNameArray($fields)
    {
        if (count($fields) === 0) {
            return;
        }

        $names = array();

        foreach ($fields as &$field) {
            $names[] = $field->name;
        }

        return $names;
    }
982898
public static function getAll($fields = null)
    {
        $table = self::getTableNameFromClass();

        if ($fields != null && is_array($fields)) {
            $query =  "SELECT ". implode(', ', $fields) ." FROM $table";
        } else {
            $query = "SELECT * FROM $table";
        }

        $res = [];

        $results = Connection::db()->query($query);
        $results->setFetchMode(PDO::FETCH_ASSOC);

        while ($row = $results->fetch()) {
            array_push($res, $row);
        }

        return $res;
    }
657561
public function parseField($fields){
        if(empty($fields)) {
            $fields    = array();
        }
        if(is_string($fields)) {
            $_fields    = explode(',',$fields);
            $fields     = array();
            foreach ($_fields as $f)
                $fields[$f] = true;
        }elseif(is_array($fields)) {
            $_fields    = $fields;
            $fields     = array();
            foreach ($_fields as $f=>$v) {
                if(is_numeric($f))
                    $fields[$v] = true;
                else
                    $fields[$f] = $v ? true : false;
            }
        }
        return $fields;
    }
915269
private function prepareFields(array $fields)
    {
        $preparedFields = [];

        foreach ($fields as $field) {
            $preparedFields[$field->getName()] = $field;
        }

        return $preparedFields;
    }