Get attrubute value for the field.

@param array $field
@param \Magento\Sales\Model\Order $orderData

@return float|int|null|string
510910
public function _getCustomAttributeValue($field, $orderData)
    {
        $type = $field['DATA_TYPE'];

        $function = 'get';
        $exploded = explode('_', $field['COLUMN_NAME']);
        foreach ($exploded as $one) {
            $function .= ucfirst($one);
        }

        $value = null;
        try {
            switch ($type) {
                case 'int':
                case 'smallint':
                    $value = (int)$orderData->$function();
                    break;

                case 'decimal':
                    $value = (float)number_format(
                        $orderData->$function(),
                        2,
                        '.',
                        ''
                    );
                    break;

                case 'timestamp':
                case 'datetime':
                case 'date':
                    $value = $orderData->$function();
                    break;

                default:
                    $value = $orderData->$function();
            }
        } catch (\Exception $e) {
            $this->helper->debug((string)$e, []);
        }

        return $value;
    }
765418
public function order($field, $order = '')
    {
        if (is_array($field)) {
            $this->options['sort'] = $field;
        } else {
            $this->options['sort'][$field] = 'asc' == strtolower($order) ? 1 : -1;
        }
        return $this;
    }
1143575
public function setOrder($order_field, $order_type)
    {
        $this->orderField = $order_field;
        $this->orderType = $order_type;
        $this->queryBuilder->orderBy($order_field, $order_type);

        return $this;
    }
968148
public function order($field) {
        $order = [];
        if (is_array($field)) {
            foreach ($field as $key => $value) {
                $order[] = $key . ' ' . $value;
            }
        } else {
            $order = func_get_args();
        }
        $order = implode(',', $order);
        $this->order = !empty($order) ? ' ORDER BY ' . $order : '';
        return $this;
    }
1080198
public function getFieldByOrder($order)
    {
        foreach ($this->_fields as $field) {
            if ($field instanceof FieldInterface) {
                if ($field->getOrder() == $order) {
                    return $field;
                }
            }
        }

        return null;
    }
725962
public function order($field, $order = null)
    {
        if (!empty($field)) {
            if (is_string($field)) {
                if (!empty($this->options['via'])) {
                    $field = $this->options['via'] . '.' . $field;
                }
                $field = empty($order) ? $field : [$field => $order];
            } elseif (!empty($this->options['via'])) {
                foreach ($field as $key => $val) {
                    if (is_numeric($key)) {
                        $field[$key] = $this->options['via'] . '.' . $val;
                    } else {
                        $field[$this->options['via'] . '.' . $key] = $val;
                        unset($field[$key]);
                    }
                }
            }
            if (!isset($this->options['order'])) {
                $this->options['order'] = [];
            }
            if (is_array($field)) {
                $this->options['order'] = array_merge($this->options['order'], $field);
            } else {
                $this->options['order'][] = $field;
            }
        }
        return $this;
    }
1335807
private function getFieldValue($field)
    {
        return isset($this->values[$field]) ? $this->values[$field] : null;
    }
54872
public function find($key, $values, $order = null)
	{
        if(is_array($values) == false)
            $arrayOfValues = array($values);
        else
            $arrayOfValues = $values;
		$orderString = '';
        if($this->basicCheck($key, $arrayOfValues) == true)
        {
			$orderChecked = strcasecmp('DESC', $order) == 0 ? 'DESC' : '';
			$orderString = ' ORDER BY '.$key.' '.$orderChecked;
            $this->_query = 'SELECT * FROM '.$this->_tableName.' WHERE '.$this->composeQuery($key, $arrayOfValues).$orderString;
            return $this->findExecute();
        }
        return false;
	}
72497
public function getMerchantOrderParamValue($orderIndex = 0, $paramIndex = 0)
    {
        $orderParam = $this->getMerchantOrderParams($orderIndex);
        return array_key_exists('value', $orderParam[$paramIndex]) ? $orderParam[$paramIndex]['value'] : null;
    }
936948
public function getOrderNumber($orderIndex = 0)
    {
        $orderStatuses = $this->getOrderStatuses();
        return array_key_exists('orderNumber', $orderStatuses[$orderIndex])
            ? $orderStatuses[$orderIndex]['orderNumber'] : null;
    }
118687
public function where(array $parameters, string $field = null, string $order = null)
    {
        $query = $this->model->with($this->with)->where($parameters);
        if ($order) {
            $query->orderBy($field, $order);
        }
        $response = $query->get();
        $this->with = [];
        return $response;
    }
1214027
public function byFieldValue(
        string $field,
        string $order
    ): SortBy {
        $this->sortsBy[] = [
            'type' => self::TYPE_FIELD,
            'field' => Item::getPathByField($field),
            'order' => $order,
        ];

        return $this;
    }
4965
public function setOrder($order_field, $order_type)
    {
        $this->order_field = $order_field;
        $this->order_type  = $order_type;
        $this->queryBuilder->orderBy($order_field, $order_type);
        return $this;
    }
1143073
public function getFieldValue($field, $data = null)
    {
        if ($data !== null && isset($data[$field])) {
            return $data[$field];
        }
        if (isset($this->{$field})) {
            return $this->{$field};
        }
        return null;
    }
972595
public function fieldSelectAll($table, $fields, $where, $orderBy = null)
    {
        $table = $this->getTableName($table);

        $query = "SELECT ";

        $query .= $this->selectFields($fields);

        $query .= " FROM " . $table . " ";

        $params = null;
        if ($where !== self::NO_WHERE_CLAUSE) {
            $query .= "WHERE " . $this->where($where, $params);
        }

        if ($orderBy) {
            $query .= $this->orderBy($orderBy) . " ";
        }

        return $this->query($query, $params);
    }
167214
private function getOrderField(): int
    {
        $result = (int)array_search($this->searchData['sort_by_field'], $this->getDisplayColumns());

        if ($this->batch && !$this->getGroupByField()) {
            $result += 1;
        }

        return $result;
    }
209168
public function orderBy($field, $sort)
    {
        $this->orderBy = $field;
        $this->sortBy  = $sort;
        return $this;
    }