# getAliases method

1. @override

List<String> getAliases(

1. String name

)
override

Retrieves all aliases registered for the given primary `name`.

Returns a list of all alternative names that have been registered for the specified primary `name`. If no aliases exist for the name, returns an empty list.

## Parameters:

- `name`: The primary name to retrieve aliases for

## Returns:

A list of alias strings for the given primary name, or an empty list if no aliases are registered.

## Example:

    final registry = MyAliasRegistry();
    registry.registerAlias('paymentGateway', 'payGateway');
    registry.registerAlias('paymentGateway', 'paymentProcessor');
    registry.registerAlias('paymentGateway', 'gateway');

    final aliases = registry.getAliases('paymentGateway');
    print(aliases); // ['payGateway', 'paymentProcessor', 'gateway']

    // For a name with no aliases
    final noAliases = registry.getAliases('shoppingCart');
    print(noAliases); // []

## Implementation

    @override
    List<String> getAliases(String name) {
      String transformed = transformedPodName(name);
    		List<String> aliases = [];

    		bool hasFactoryPrefix = (name.isNotEmpty && name.first() == PodUtils.POD_PROVIDER_PREFIX);
    		String fullname = transformed;

    		if (hasFactoryPrefix) {
    			fullname = podProviderName(transformed);
    		}

    		if (fullname.notEquals(name)) {
    			aliases.add(fullname);
    		}

    		final retrievedAliases = super.getAliases(transformed);
    		String prefix = (hasFactoryPrefix ? PodUtils.POD_PROVIDER_PREFIX : "");
    		for (String retrievedAlias in retrievedAliases) {
    			String alias = prefix + retrievedAlias;
    			if (!alias.equals(name)) {
    				aliases.add(alias);
    			}
    		}

    		if (!containsSingleton(transformed) && !containsDefinition(transformed)) {
    			final parent = getParentFactory();
    			if (parent != null) {
    				aliases.addAll(parent.getAliases(fullname));
    			}
    		}

    		return aliases;
    }