protected function mapData(array $data, array $options)
    {
        if (!isset($options['settings_field'])) {
            $field = $options['key_field'] ?? 'key';
            expect_type($field, 'string', \BadMethodCallException::class);

            unset($data[$field]);
        } else {
            $field = $options['settings_field'];

            if (!isset($data[$field]) && !(bool)($options['optional'] ?? false)) {
                throw new LoadException("DynamoDB item '{$options['key_value']}' doesn't have a '$field' field");
            }

            $data = $data[$field] ?? [];
        }

        return $data;
    }
protected function mapData(array $data, array $options)
    {
        if (!isset($options['settings_field'])) {
            $field = $options['key_field'] ?? 'key';
            expect_type($field, 'string', \BadMethodCallException::class);

            unset($data[$field]);
        } else {
            $field = $options['settings_field'];

            if (!isset($data[$field]) && !(bool)($options['optional'] ?? false)) {
                throw new LoadException("DynamoDB item '{$options['key_value']}' doesn't have a '$field' field");
            }

            $data = $data[$field] ?? [];
        }

        return $data;
    }
protected function mapData ( array $ data , array $ options ) { if ( ! isset ( $ options [ 'settings_field' ] ) ) { $ field = $ options [ 'key_field' ] ?? 'key' ; expect_type ( $ field , 'string' , \ BadMethodCallException :: class ) ; unset ( $ data [ $ field ] ) ; } else { $ field = $ options [ 'settings_field' ] ; if ( ! isset ( $ data [ $ field ] ) && ! ( bool ) ( $ options [ 'optional' ] ?? false ) ) { throw new LoadException ( "DynamoDB item '{$options['key_value']}' doesn't have a '$field' field" ) ; } $ data = $ data [ $ field ] ?? [ ] ; } return $ data ; }
Get the map with settings from the data.

@param array $data
@param array $options
@return array|mixed
Get the map with settings from the data .