public static function arrayKeyAssoc($array_map, $value)
    {

        if (is_string($value)) {
            if (($val = array_search($value, $array_map)) === false)
                throw new Exception('Value string undefined: ' . $value);
            return $val;
        } else if (is_int($value)) {
                if (!array_key_exists('' . $value, $array_map))
                    throw new Exception('Key value undefined: ' . $value);
                return $array_map['' . $value];
        }

        throw new Exception('Invalid type for arrayKeyAssoc: ' . ClassUtils::getQualifiedType($value));
    }