Gets the signature of the getData method.

@param array $fields

@return string
162609
protected function getDataMethod(array $fields)
    {
        $stub = $this->getStubContent('controller-getdata-method');

        $this->replaceFileSnippet($stub, $this->getFileSnippet($fields, '$this'))
            ->replaceValidationRules($stub, $this->getValidationRules($fields))
            ->replaceFillables($stub, $this->getFillables($fields))
            ->replaceBooleadSnippet($stub, $this->getBooleanSnippet($fields))
            ->replaceStringToNullSnippet($stub, $this->getStringToNullSnippet($fields))
            ->replaceRequestNameComment($stub, '')
            ->replaceMethodVisibilityLevel($stub, 'public');

        $stub = str_replace(PHP_EOL . PHP_EOL, PHP_EOL, $stub);

        return $stub;
    }
435232
public function getField($field)
    {
        // Skip invalid fields
        $fields = $this->compositeDatabaseFields();
        if (!isset($fields[$field])) {
            return null;
        }

        // Check bound object
        if ($this->record instanceof DataObject) {
            $key = $this->getName() . $field;
            return $this->record->getField($key);
        }

        // Check local record
        if (isset($this->record[$field])) {
            return $this->record[$field];
        }
        return null;
    }
429153
public function getField($field)
    {
        return isset($this->data[$field])
            ? $this->data[$field]
            : $this->searchField($field);
    }
1103904
public function get($field) {
        return key_exists($field, $this->_properties) ? $this->_properties[$field] : null;
    }
259872
private static function getFieldTypeArray($fields)
    {
        if (count($fields) === 0) {
            return;
        }

        $types = array();

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

        return $types;
    }
725505
public static function quoteFieldNames($fields)
    {
        $fieldArr = is_string($fields) ? explode(',', trim($fields)) : (array)$fields;
        
        foreach ($fieldArr as $k => $field) {
            $field = preg_replace("/(\s+)/", ' ', trim($field));
            if ($field == '*') {
                // do nothing
            } elseif (false !== strpos($field, '(')) {
                if (preg_match("/(.*?)\\((.*?)\\)(.*)/i", $field, $match)) {
                    // xx() | xx(xx) | xx(xx)xx
                    $field = $match[1] . '(' . QueryBuilder::quoteFieldName($match[2]).')' . QueryBuilder::quoteFieldName($match[3]);
                } else {
                    // xx( | xx(xx
                    $field = preg_replace_callback(
                        "/\\((.+)/i",
                        function($match) {
                            return '('.QueryBuilder::quoteFieldName($match[1]);
                        },
                        $field
                    );
                }

                $fieldArr[$k] = $field;
            } elseif (false !== strpos($field, ')')) {
                // xx)
                $field = preg_replace_callback(
                    "/(.*)\\)/i",
                    function($match) {
                        return QueryBuilder::quoteFieldName($match[1]) . ')';
                    },
                    $field
                );
                
                $fieldArr[$k] = QueryBuilder::quoteFieldName(substr($field, 0, strlen($field) - 1)) . ')';
            } else {
                $fieldArr[$k] = QueryBuilder::quoteFieldName($field);
            }
        }
        
        $rFields = implode(',', $fieldArr);        
        
        return $rFields;
    }
1150597
protected static function query($fields)
    {
        $result = Query::from(static::$table);

        $result = $result->where();

        foreach ($fields as $key => $value) {
            $result = $result->andWhere($key, '=', $value);
        }

        return $result->get();
    }
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;
	}
453722
protected function parseField($fields) {
        if(is_string($fields) && '' !== $fields) {
            $fields    = explode(',',$fields);
        }
        if(is_array($fields)) {
            // 完善数组方式传字段名的支持
            // 支持 'field1'=>'field2' 这样的字段别名定义
            $array   =  array();
            foreach ($fields as $key=>$field){
                if(!is_numeric($key))
                    $array[] =  $this->parseKey($key).' AS '.$this->parseKey($field);
                else
                    $array[] =  $this->parseKey($field);
            }
            $fieldsStr = implode(',', $array);
        }else{
            $fieldsStr = '*';
        }
        //TODO 如果是查询全部字段，并且是join的方式，那么就把要查的表加个别名，以免字段被覆盖
        return $fieldsStr;
    }
1285664
protected function getMetaboxData(Collection $fields)
    {
        $data = [];

        foreach ($fields as $field) {
            $data[$field['name']] = $field['value'];
        }

        return $data;
    }
607170
public function get($fields = null)
    {
        if (!empty($fields)) {
            $this->fields($fields);
        }

        return $this->httpGetRequest($this->buildUrl());
    }
518128
public static function packFields(array $fields): string
    {
        $fmt = '';
        $args = [];

        // populate format string and argument list
        foreach ($fields as [$format, $value]) {
            if ($format === 'P') {
                $fmt .= 'VV';
                if ($value instanceof Bigint) {
                    $args[] = $value->getLow32();
                    $args[] = $value->getHigh32();
                } else {
                    $args[] = $value;
                    $args[] = 0;
                }
            } else {
                if ($value instanceof Bigint) {
                    $value = $value->getLow32();
                }
                $fmt .= $format;
                $args[] = $value;
            }
        }

        // prepend format string to argument list
        array_unshift($args, $fmt);

        // build output string from header and compressed data
        return pack(...$args);
    }
562934
protected function getOnStoreAction(array $fields)
    {
        $final = [];

        foreach ($fields as $field) {
            $action = $this->extractClassFromString($field->onStore);
            if (!empty($action)) {
                $final[] = $this->getArrayReadyString($field->name, $action);
            }
        }

        return implode(PHP_EOL, $final);
    }
1119444
public function load(array $fields)
    {
        $this->quote->setStoreId($this->storeManager->getStore()->getId());

        foreach ($fields as $rawFields) {
            $method = 'set' . SimpleDataObjectConverter::snakeCaseToUpperCamelCase($rawFields);
            $this->log->debug('Starting method ' . $method);
            $this->{$method}();
            $this->log->debug('Finished method ' . $method);
        }

        return $this->quote;
    }
849677
public static function getNameFromArray(array $properties)
    {
        if (!Helpers::isKeyExists($properties, 'name')
            || empty($fieldName = Helpers::removeNonEnglishChars($properties['name']))
        ) {
            throw new Exception("The field 'name' was not provided!");
        }

        return $fieldName;
    }
930798
protected function getContentDbFieldsStmt(array $fields)
    {
        $query = $this->databaseHandler->createSelectQuery();
        $query->select($fields)
            ->from($this->databaseHandler->quoteTable(self::CONTENTOBJECT_TABLE))
            ->where($query->expr->eq('status', ContentInfo::STATUS_PUBLISHED));
        $stmt = $query->prepare();
        $stmt->execute();

        return $stmt;
    }
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;
    }