CakeDC\Users\Auth\Social\Mapper\AbstractMapper::_map PHP Method

_map() protected method

Maps raw data using mapFields
protected _map ( ) : mixed
return mixed
    protected function _map()
    {
        $result = [];
        collection($this->_mapFields)->each(function ($mappedField, $field) use(&$result) {
            $value = Hash::get($this->_rawData, $mappedField);
            $function = '_' . $field;
            if (method_exists($this, $function)) {
                $value = $this->{$function}();
            }
            $result[$field] = $value;
        });
        $token = Hash::get($this->_rawData, 'token');
        $result['credentials'] = ['token' => is_array($token) ? Hash::get($token, 'accessToken') : $token->getToken(), 'secret' => is_array($token) ? Hash::get($token, 'tokenSecret') : null, 'expires' => is_array($token) ? Hash::get($token, 'expires') : $token->getExpires()];
        $result['raw'] = $this->_rawData;
        return $result;
    }