Checks if field is aggregated value

@param string $field
@return boolean
763962
private function isAggregated($field)
    {
        $cols = $this->getDataGrid()->getColModel();
        
        foreach ($cols as $col){
            if ($col['index'] === $field && isset($col['aggregated']) && $col['aggregated'] === true){
                return true;
            }
        }
        
        return false;
    }
145317
private function IsFieldLocked($field)
    {
        if (!is_array($this->locked_fields)) {
            return false;
        }
        $locked_tables = array_keys($this->locked_fields);
        $locked_fields = array_values($this->locked_fields);
        $_locked_fields = array();

        foreach ($locked_fields as $locked_field) {
            if (is_array($locked_field)) {
                foreach ($locked_field as $_locked_field) {
                    $_locked_fields[] = $_locked_field;
                }
            } else {
                $_locked_fields[] = $locked_field;
            }
        }

        if (in_array($this->table, $locked_tables) and in_array($field, $_locked_fields)) {
            return true;
        }

        return false;
    }
1033092
public function count($field = '*')
    {
        if (isset($this->options['group'])) {
            // 支持GROUP
            $options = $this->getOptions();
            $subSql  = $this->options($options)->field('count(' . $field . ')')->bind($this->bind)->buildSql();
            return $this->table([$subSql => '_group_count_'])->value('COUNT(*) AS tp_count', 0, true);
        }

        return $this->value('COUNT(' . $field . ') AS tp_count', 0, true);
    }
1272656
public function hasChanges(string $field = null): bool
    {
        //Check updates for specific field
        if (!empty($field)) {
            if (array_key_exists($field, $this->changes)) {
                return true;
            }

            //Do not force accessor creation
            $value = $this->getField($field, null, false);
            if ($value instanceof RecordAccessorInterface && $value->hasChanges()) {
                return true;
            }

            return false;
        }

        if (!empty($this->changes)) {
            return true;
        }

        //Do not force accessor creation
        foreach ($this->getFields(false) as $value) {
            //Checking all fields for changes (handled internally)
            if ($value instanceof RecordAccessorInterface && $value->hasChanges()) {
                return true;
            }
        }

        return false;
    }
1288225
protected function isRelation($field)
    {
        //get relation name from dot notation
        if (strpos($field, '.') !== false) {
            list($field, $columnName) = explode('.', $field);
        }
        $has_ones = singleton($this->objectClass)->has_one();
        //check if relation is present in has ones
        return isset($has_ones[$field]);
    }
955848
public function countSame(Field $field)
    {
        $sum = 0;
        foreach ($this->fields as $v) {
            if ($v === $field) {
                $sum ++;
            }
        }
        return $sum;
    }
1235419
public function hasError($field)
    {
        if (empty($this->_context['errors'])) {
            return false;
        }

        return (bool)Hash::check($this->_context['errors'], $field);
    }
162107
public function max($field)
    {
        $field = $field instanceof Raw ? $field->toString() : "`{$field}`";
        return $this->select(new Raw("MAX({$field}) as `aggregation`"))->limit(1)->fetch()->aggregation;
    }
418124
public function remove($field)
    {
        return (bool) $this->getClient()->hdel(
            $this->getKey()->getName(), $field
        );
    }
930807
private function aggregation($field, $isMulti = false, $useMaster = false, $operation = 'COUNT')
    {
        is_string($isMulti) && $this->groupBy($isMulti)->columns($isMulti);
        $count = $this->columns(["{$operation}({$field})" => '__res__'])->select(null, null, $useMaster);
        if ($isMulti) {
            $return = [];
            foreach ($count as $val) {
                $return[$val[$isMulti]] = $operation === 'COUNT' ? intval($val['__res__']) : floatval($val['__res__']);
            }
            return $return;
        } else {
            return $operation === 'COUNT' ? intval($count[0]['__res__']) : floatval($count[0]['__res__']);
        }
    }
1335807
private function getFieldValue($field)
    {
        return isset($this->values[$field]) ? $this->values[$field] : null;
    }
1136611
public function isString($field)
    {
        $def = strtolower($this->getFieldDefinition($field));
        if (strpos($def, 'varchar') !== false) {
            return true;
        }
        if (strpos($def, 'text') !== false) {
            return true;
        }
        return false;
    }
1132829
public function count($field = '*')
    {
        $r = 0;
        foreach ($this->queries as $query) {
            $t = $query->count($field);
            $r += $t;
        }

        return $r;
    }
689423
public function hasSort(string $field): bool
    {
        foreach ($this->sorts as $sort) {
            if ($field === $sort->getField()) {
                return true;
            }
        }

        return false;
    }
1008330
public function addSubdescriptorField($field)
    {
        if (is_null($this->_subdescriptor)) {
            $this->_subdescriptor = [];
        }
        if (isset($this->object)) {
            $fieldValue = $this->object->getFieldValue($field);
            if (!empty($fieldValue) && !in_array($fieldValue, $this->_subdescriptor)) {
                $this->_subdescriptor[] = $fieldValue;

                return true;
            }
        }

        return false;
    }
876766
public function isValidField(string $field): bool {
        $result = empty($this->errors[$field]);
        return $result;
    }
1059458
protected function isFillable(string $field): bool
    {
        if (static::FILLABLE === '*') {
            return true;
        }

        if (!empty(static::FILLABLE)) {
            return in_array($field, static::FILLABLE);
        }

        if (static::SECURED === '*') {
            return false;
        }

        return !in_array($field, static::SECURED);
    }