Attribute Mapping with key path
-
Hello
It would be nice to manage path in “Attribute Mapping” keys, like “key.subkey”. It’ll permit to access value in user info api result.
If you have a git somewhere I can send you a pull request.
I did a try with code like
/** * Retrieve a key in a structured data. * Key path separator is "." like "k1.k2". */ public static function array_getKeyPath( Array & $array, $keyPath, $default = null ) { if( empty($array) || (! is_array($array)) ) return $default ; $ar =& $array ; $value = $default ; foreach( explode('.',$keyPath) as $key ) { if( isset($ar[$key]) ) { $value = $ar[$key]; $ar =& $ar[$key] ; } else { return $default ; } } return $value ; }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Attribute Mapping with key path’ is closed to new replies.