Return the key of a map given the value
This method assumes the data map has a one-to-one relationship

@param $field Field to be resolved
@param $map Map to use for resolution
@return string|null
335101
private static function reverseResolve($field, $map)
    {
        $backwardMap = array_reverse($map);
        if (array_key_exists($field, $backwardMap)) {
            return $backwardMap[$field];
        } else {
            // TODO: Appropriate Exception
            return null;
        }
    }
958288
private function getMapping(\SimpleXmlElement $mapping, $field)
    {
        $field = $mapping->$field;

        if (!$field->getName()) {
            return;
        }

        return $this->getField($field);
    }
472686
final public function getRowFieldValue($field)
    {

        //If value exists;
        if (array_key_exists($field, $this->schema)) {
            return $this->schema[$field]->Value;
        }
        return null;
    }
239256
public function getFieldValue($key)
    {
        $key = strtolower($key);

        foreach ($this->fields as $part => $value) {
            if (strtolower($part) === $key) {
                if (is_array($value)) {
                    return reset($value);
                } else {
                    return $value;
                }
            }
        }

        return null;
    }
233908
public function get($field_key)
	{
		if ( isset($this->fields[$field_key]) ) {
			return $this->fields[$field_key];
		}

		return null;
	}
642334
protected function resolveValue($field)
    {
        $cur = &$this->_record;
        if (array_key_exists($field, $cur)) {
            $cur = &$cur[$field];
        } else {
            return null;
        }
        return $cur;
    }
735146
public static function hashMap($map)
    {
        $cache = '';
        foreach ($map as $key => $value) {
            $cache .= 0xAB01 . $key . 0xAB02;
            if (is_array($value)) {
                $cache .= 0xAB04 . static::hashMap($value);
            } else {
                $cache .= 0xAB03 . $value;
            }
        }
        return md5($cache);
    }
470294
public function getMap(string $field, string $key = 'id', Condition $condition = null): array
    {
        $result = [];
        $items = $this->findAll($condition);
        foreach ($items as $item) {
            $data = $item->mapToArray();
            if (isset($data[$key])) {
                $result[$data[$key]] = $data[$field] ?? null;
            }
        }
        return $result;
    }
134137
public function getField($field)
    {
        if (!$this->isFieldSupported($field)) {
            return null;
        }

        if (!$this->hasLoadedField($field)) {
            $loaderData = $this->getLoaderData($field);
            if (isset($this->normalizersMap[$field])) {
                $normalizerName = $this->normalizersMap[$field];
                $normalizerFunction = sprintf('%sNormalizer', $normalizerName);
                $this->fields[$field] = $this->$normalizerFunction($loaderData);
            } else {
                $this->fields[$field] = $loaderData;
            }
        }

        return parent::getField($field);
    }
354954
public function hget($key, $field)
    {
        $this->init();
        $result = $this->driver->hget($key, $field);
        return $this->convertFalseToNull($result);
    }
663813
private function getMapKeys(string $field): ?array
    {
        $keys = [];
        foreach ($this->data as $row) {
            if (array_key_exists($field, $row) and !in_array($row[$field], $keys) and !is_null($row[$field])) {
                $keys[] = $this->table->escape($row[$field]);
            }
        }

        // 如果本表关联字段无值,不处理
        if (!count($keys)) {
            return null;
        }

        return $keys;
    }
1150442
protected function getAddressFieldValue($field)
    {
        if ($field instanceof \Closure) {
            return call_user_func($field, $this);
        }

        if (is_array($field)) {
            return $this->getRelationalField($field);
        }

        return $this->{$field};
    }
624368
function kv($map=null){
        $filed = $this->fields;
        $map = $map?:$filed;
        $filed = explode(',',$map);
        switch(count($filed)) {
            case 0:
            case 1:
                !$filed[0] and new \Exception('fetchKv cat`t fields is null');
                $k = null;//$filed[0];
                $v = $filed[0];
                $this->fields = $v;//'*';
                break;
            case 2:
                $k = $filed[0];
                if($filed[1]=='*') {
                    $v = null;
                    $this->fields = '*';
                }
                else {
                    $v = $filed[1];
                }
                break;
            default:
                $k = $filed[0];
                $v = null;
                $this->fields = $map;
                break;
        }
        $result = $this->query()->fetchAll(PDO::FETCH_ASSOC);

        if($result) {
            $result = array_column($result, $v, $k);
            $result = $this->_data($result,false);
        }
        return $result;
    }
1199956
public function canMap(Field $field)
    {
        return
            $field->type instanceof FieldType\MultipleStringField ||
            $field->type instanceof FieldType\TextField ||
            $field->type instanceof FieldType\FullTextField;
    }
1278102
public function getUserField($field)
    {
        //$cache = self::getCacheFactory();
        //return unserialize($cache->load($this->getFieldCacheKey($field)));

        if (isset(self::$cachedFields[$this->ID][$field])) {
            return self::$cachedFields[$this->ID][$field];
        } elseif ($userField = $this->Fields()->find('Name', $field)) {
            return self::$cachedFields[$this->ID][$field] = (string)$userField->getField('Value');
        }

        return null;
    }
1316740
private function getRelation($field)
    {
        $relations = $this->getRelations();
        return isset($relations[$field]) ? $relations[$field] : null;
    }
1246244
protected function key($field)
    {
        if (method_exists($this->model, 'getTrueKey')) {
            return $this->model->getTrueKey($field);
        }

        return $field;
    }