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));
    }
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));
    }
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 ) ) ; }
Returns the associated value from the array based on the type of value given

@param array      $array_map An array of the type [1 => string, int => string]
@param string/int $value     An integer or string to find the associated value for

@return string or int If input was a string, the associated integer,
If was integer, the associated string
Returns the associated value from the array based on the type of value given