protected function getElementByKey($array, $getKey = null, $default = null)
    {
        $data = $array;
        if ($getKey) {
            $keyParts = explode(':', $getKey);
            foreach ($keyParts as $key) {
                if (is_array($data) && isset($data[$key])) {
                    $data = $data[$key];
                } elseif (is_object($data) && isset($data->$key)) {
                    $data = $data->$key;
                } else {
                    $data = null;
                    break;
                }
            }
        }

        if ($data === null) {
            $data = $default;
        }

        return $data;
    }
protected function getElementByKey($array, $getKey = null, $default = null)
    {
        $data = $array;
        if ($getKey) {
            $keyParts = explode(':', $getKey);
            foreach ($keyParts as $key) {
                if (is_array($data) && isset($data[$key])) {
                    $data = $data[$key];
                } elseif (is_object($data) && isset($data->$key)) {
                    $data = $data->$key;
                } else {
                    $data = null;
                    break;
                }
            }
        }

        if ($data === null) {
            $data = $default;
        }

        return $data;
    }
protected function getElementByKey ( $ array , $ getKey = null , $ default = null ) { $ data = $ array ; if ( $ getKey ) { $ keyParts = explode ( ':' , $ getKey ) ; foreach ( $ keyParts as $ key ) { if ( is_array ( $ data ) && isset ( $ data [ $ key ] ) ) { $ data = $ data [ $ key ] ; } elseif ( is_object ( $ data ) && isset ( $ data -> $ key ) ) { $ data = $ data -> $ key ; } else { $ data = null ; break ; } } } if ( $ data === null ) { $ data = $ default ; } return $ data ; }
get all values or vulue by key

Example: 'key:123:qwe' => $array['key']['123']['qwe'] or $object->key->123->qwe

@param null|string  $getKey
@param null|mixed   $default
@param array|object $array

@return mixed
get all values or vulue by key