\LiftKit\ModuleModule

Module Class

Represents a LiftKit module. Each module represents a distinct piece of functionality. The module object is responsible for initializing resources before a Request is routed. It is recommended at each module be packaged with related Models, Controllers, etc in its own repository.

Summary

Methods
Properties
Constants
__construct()
initialize()
createSubModule()
addSubModule()
getSubModules()
getSubModule()
No public properties found
No constants found
No protected methods found
$container
N/A
No private methods found
No private properties found
N/A

Properties

$container

$container : \LiftKit\DependencyInjection\Container\Container

Dependency Injection container

Type

\LiftKit\DependencyInjection\Container\Container

Methods

__construct()

__construct(\LiftKit\DependencyInjection\Container\Container  $container) 

Initializes object

Parameters

\LiftKit\DependencyInjection\Container\Container $container

initialize()

initialize() 

Provides instructions for initializing resources and bootstrapping the application. It is recommended that this method delegate its responsibilities to other more specific methods.

This method must be implemented in all modules.

createSubModule()

createSubModule(string  $className) : \LiftKit\Module\Module

This method accepts a fully-qualified class name and creates it.

Parameters

string $className

Fully-qualified class name

Throws

\LiftKit\Module\Exception\NonexistentSubModule

Returns

\LiftKit\Module\Module

addSubModule()

addSubModule(string  $moduleKey, \LiftKit\Module\Module  $module) 

Attaches a Module as a sub module. May be referenced in the future by the module key.

Parameters

string $moduleKey

A string identifier for future references to the sub module.

\LiftKit\Module\Module $module

The Module to be attached

getSubModules()

getSubModules() : array<mixed,\LiftKit\Module\Module>

Returns an array of all sub-modules.

Returns

array<mixed,\LiftKit\Module\Module>

getSubModule()

getSubModule(  $moduleKey) : \LiftKit\Module\Module

Returns a single sub-module identified by $moduleKey.

Parameters

$moduleKey

String identifier of module.

Throws

\LiftKit\Module\Exception\NonexistentSubModule

Returns

\LiftKit\Module\Module