ModuleRegistry
final class \
Internal
Always use the ModuleProvider API to access modules
Table of Contents
Methods
- __construct() : mixed
- getModule() : ModuleInterface
- getModuleAliases() : array
- getModules() : ModuleInterface[]
- hasModule() : bool
- registerRoutesForModules() : void
- Needs to be called when the router is set up, AFTER all modules are loaded.
- applyHierarchy() : ModuleInterface[]
- Applies sorting (based on the "position" configuration) to all registered modules and resolves the hierarchy (creating relations by attaching modules to the $parentModule and $subModules properties).
- applySorting() : ModuleInterface[]
- Ensures that modules within one level of hierarchy are ordered properly the way they were given respecting their "top", "bottom", "before" or "after" definition.
- flattenModules() : array
- Create a flat modules array (looping through each level by calling "getSubmodules()" on the parent)
- populateAliasMapping() : void
- populateOrderingsForDependencies() : array
- Given module identifiers are added based on their module position information to the $alreadyOrderedModuleIdentifiers array (if not already present). In case the modules to be added have dependencies to other modules and those modules exist, corresponding modules are added to $alreadyOrderedModuleIdentifiers on the correct position as well.
Methods
__construct()
public
__construct(ModuleInterface[] $modules) : mixed
Parameters
- $modules : ModuleInterface[]
getModule()
public
getModule(string $identifier) : ModuleInterface
Parameters
- $identifier : string
Return values
ModuleInterfacegetModuleAliases()
public
getModuleAliases() : array
Return values
arraygetModules()
public
getModules() : ModuleInterface[]
Return values
ModuleInterface[]hasModule()
public
hasModule(string $identifier) : bool
Parameters
- $identifier : string
Return values
boolregisterRoutesForModules()
Needs to be called when the router is set up, AFTER all modules are loaded.
public
registerRoutesForModules(Router $router) : void
Parameters
- $router : Router
applyHierarchy()
Applies sorting (based on the "position" configuration) to all registered modules and resolves the hierarchy (creating relations by attaching modules to the $parentModule and $subModules properties).
protected
applyHierarchy(ModuleInterface[] $modules) : ModuleInterface[]
Parameters
- $modules : ModuleInterface[]
Return values
ModuleInterface[]applySorting()
Ensures that modules within one level of hierarchy are ordered properly the way they were given respecting their "top", "bottom", "before" or "after" definition.
protected
applySorting(ModuleInterface[] $modules) : ModuleInterface[]
Parameters
- $modules : ModuleInterface[]
Return values
ModuleInterface[]flattenModules()
Create a flat modules array (looping through each level by calling "getSubmodules()" on the parent)
protected
flattenModules(array $modules[, mixed $flatModules = [] ]) : array
Parameters
- $modules : array
- $flatModules : mixed = []
Return values
arraypopulateAliasMapping()
protected
populateAliasMapping() : void
populateOrderingsForDependencies()
Given module identifiers are added based on their module position information to the $alreadyOrderedModuleIdentifiers array (if not already present). In case the modules to be added have dependencies to other modules and those modules exist, corresponding modules are added to $alreadyOrderedModuleIdentifiers on the correct position as well.
protected
populateOrderingsForDependencies(array $moduleIdentifiersToBeAdded, array $modulePositionInformation[, array $alreadyOrderedModuleIdentifiers = [] ]) : array
Parameters
- $moduleIdentifiersToBeAdded : array
- $modulePositionInformation : array
- $alreadyOrderedModuleIdentifiers : array = []