获取字段名字

@param $field
@return mixed
967736
protected function getName($field)
    {
        if (is_array($this->name)) {
            return isset($this->name[$field]) ? $this->name[$field] : $field;
        }

        return $this->name ?: $field;
    }
286699
public function getQualifiedFieldName($field)
	{
		$tbl = ($this->getTableAlias() ? $this->getTableAlias() : $this->getTableName());
		return $tbl . '.' . $field;
	}
1016704
public function getName($name, $field = null, $type = null)
    {
        return implode('_', array_filter(array($type, $field, $name)));
    }
113255
public function type($field)
    {
        $parts = explode('.', $field);
        $table = $this->_getTable($parts);

        return $table->getSchema()->baseColumnType(array_pop($parts));
    }
242666
public function count($field = '')
    {
        if ($field === '') {
            $query = [];
        } else {
            $query = (array) $field;
        }
        return count($this->select($query));
    }
1343815
public function original($field = null)
    {
        if (!$field) {
            return $this->_original;
        }
        return isset($this->_original[$field]) ? $this->_original[$field] : null;
    }
558904
public function count($field = '*')
    {
        if (!empty($this->options['group'])) {
            // 支持GROUP
            $options = $this->getOptions();
            $subSql  = $this->options($options)
                ->field('count(' . $field . ') AS think_count')
                ->bind($this->bind)
                ->buildSql();

            $query = $this->newQuery()->table([$subSql => '_group_count_']);

            if (!empty($options['fetch_sql'])) {
                $query->fetchSql(true);
            }

            $count = $query->aggregate('COUNT', '*');
        } else {
            $count = $this->aggregate('COUNT', $field);
        }

        return is_string($count) ? $count : (int) $count;
    }
1362599
public static function getColumnName($field)
    {
        static::init();
        if (!static::fieldExists($field)) {
            throw new Exception('getColumnName called on nonexisting column: ' . get_called_class().'->'.$field);
        }

        return static::$_classFields[get_called_class()][$field]['columnName'];
    }
879080
public function findValue($field) {
        $row = $this->select($field)->findOne();

        //false or null
        if (!$row) {
            return $row;
        }

        return $row[$field];
    }
2946
public static function cleanField($field) {
        if ('*' == $field) {
            return $field;
        }
        $strings = explode('.', $field);
        $fields  = [];
        foreach ($strings as $str) {
            $strs = preg_split('#\bas\b#i', $str);
            $fs   = [];
            foreach ($strs as $s) {
                if ($s == '*') {
                    $fs [] = '*';
                } else {
                    $fs [] = '`' . trim(trim(trim($s), '`')) . '`';
                }
            }
            $fields [] = implode(' AS ', $fs);
        }

        return implode('.', $fields);
    }
899535
public function get($field)
    {
        if (!is_null($this->filtered) && ! is_null($this->filtered[0])) {
            return isset($this->filtered[0][0][$field]) ? $this->filtered[0][0][$field] : null;
        }

        // Todo: Get values of entities
    }
796940
public function getLength($field)
    {
        $type = $field['type'];
        if (($i = strpos($type, '(')) !== false) {
            $j = strpos($type, ')', $i);

            return substr($type, $i + 1, $j - $i - 1);
        }
        return 0;
    }
1283165
protected function getFullFieldName($field, $alias = self::DEFAULT_TABLE_ALIAS, $separator = '.')
    {
        return sprintf('%s%s%s', $alias, $separator, $field);
    }
163812
public function value($field)
    {
        if (is_array($field)) {
            $values = array();
            foreach ($field as $key => $value) {
                $values[$key] = $this->value($value);
            }

            return $values;
        }

        return ($this->submitted && isset($this->values[$field])) ? $this->values[$field] : null;
    }
436192
public function get($field)
    {
        $client = $this->getClient();

        return $client->hget($this->getKey()->getName(), $field);
    }
908980
public function getJsonFieldType($field)
    {
        return isset($this->options['field_type'][$field]) ? $this->options['field_type'][$field] : null;
    }
628636
public function getFieldType($field)
    {
        $definition = $this->getFieldDefinition($field);
        if ($definition && isset($definition['type'])) {
            return $definition['type'];
        }
    }