public static function getSingleKeyOrAll($array, $key, $default = null, $nullIfEmpty = false) {
        if ($key !== null) {
            if ($nullIfEmpty === true) {
                return (isset($array[$key])) && !empty($array[$key]) ? $array[$key] : $default;
            }
            else {
                return (isset($array[$key])) ? $array[$key] : $default;
            }
        }
        else {
            return $array;
        }
    }