Module
extends Module
in package
Main module class
Tags
Table of Contents
Constants
- VERSION = '2.3.2'
- Application version
Properties
- $config : mixed
- $application : Application|null
- Application
- $config : mixed
- Application config
- $name : string|null
- Application name
- $version : string|null
- Version
Methods
- __construct() : mixed
- Constructor
- __get() : mixed
- Get a pre-designated value from the module object
- __isset() : bool
- Determine if a pre-designated value in the module object exists
- __set() : void
- Set a pre-designated value in the module object
- __unset() : void
- Unset a pre-designated value in the module object
- addConfigValue() : AbstractApplication
- Add new value to config
- application() : Application
- Get application
- cliError() : void
- CLI error handler method
- config() : mixed
- Access application config
- deleteConfigValue() : AbstractApplication
- Replace existing value in config
- getName() : string
- Get name
- getVersion() : string
- Get version
- hasName() : bool
- Determine if the name is set
- hasVersion() : bool
- Determine if version has been set
- initDb() : void
- Initialize database service
- isRegistered() : bool
- Determine if the module has been registered with an application object
- load() : AbstractApplication
- Optional method that can be used to load custom operations/configurations for an application to run
- mergeConfig() : AbstractApplication
- Merge new or altered config values with the existing config values
- offsetExists() : bool
- Determine if a value exists
- offsetGet() : mixed
- Get a value from the array
- offsetSet() : void
- Set a value in the array
- offsetUnset() : void
- Unset a value from the array
- register() : static
- Register module
- registerConfig() : AbstractApplication
- Register a new configuration with the application
- setName() : static
- Set name
- setVersion() : static
- Set version
- updateConfigValue() : AbstractApplication
- Update existing value in config
Constants
VERSION
Application version
public
string
VERSION
= '2.3.2'
Properties
$config
public
mixed
$config
mixed
$application
Application
protected
Application|null
$application
= null
$config
Application config
protected
mixed
$config
= null
$name
Application name
protected
string|null
$name
= 'pop-kettle'
$version
Version
protected
string|null
$version
= null
Methods
__construct()
Constructor
public
__construct() : mixed
Instantiate a module object
Optional parameters are an application instance or a configuration object or array
__get()
Get a pre-designated value from the module object
public
__get(string $name) : mixed
Parameters
- $name : string
__isset()
Determine if a pre-designated value in the module object exists
public
__isset(string $name) : bool
Parameters
- $name : string
Return values
bool__set()
Set a pre-designated value in the module object
public
__set(string $name, mixed $value) : void
Parameters
- $name : string
- $value : mixed
__unset()
Unset a pre-designated value in the module object
public
__unset(string $name) : void
Parameters
- $name : string
addConfigValue()
Add new value to config
public
addConfigValue(string $name, string $value) : AbstractApplication
Parameters
- $name : string
- $value : string
Return values
AbstractApplicationapplication()
Get application
public
application() : Application
Return values
ApplicationcliError()
CLI error handler method
public
cliError(Exception $exception[, bool $exit = true ]) : void
Parameters
- $exception : Exception
- $exit : bool = true
config()
Access application config
public
config() : mixed
deleteConfigValue()
Replace existing value in config
public
deleteConfigValue(string $name) : AbstractApplication
Parameters
- $name : string
Return values
AbstractApplicationgetName()
Get name
public
getName() : string
Return values
stringgetVersion()
Get version
public
getVersion() : string
Return values
stringhasName()
Determine if the name is set
public
hasName() : bool
Return values
boolhasVersion()
Determine if version has been set
public
hasVersion() : bool
Return values
boolinitDb()
Initialize database service
public
initDb(array<string|int, mixed> $database) : void
Parameters
- $database : array<string|int, mixed>
Tags
isRegistered()
Determine if the module has been registered with an application object
public
isRegistered() : bool
Return values
boolload()
Optional method that can be used to load custom operations/configurations for an application to run
public
load() : AbstractApplication
Return values
AbstractApplicationmergeConfig()
Merge new or altered config values with the existing config values
public
mergeConfig(mixed $config[, bool $preserve = false ]) : AbstractApplication
Parameters
- $config : mixed
- $preserve : bool = false
Tags
Return values
AbstractApplicationoffsetExists()
Determine if a value exists
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
booloffsetGet()
Get a value from the array
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
offsetSet()
Set a value in the array
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
- $value : mixed
offsetUnset()
Unset a value from the array
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
register()
Register module
public
register(Application $application) : static
Parameters
- $application : Application
Return values
staticregisterConfig()
Register a new configuration with the application
public
registerConfig(mixed $config) : AbstractApplication
Parameters
- $config : mixed
Tags
Return values
AbstractApplicationsetName()
Set name
public
setName(string $name) : static
Parameters
- $name : string
Return values
staticsetVersion()
Set version
public
setVersion(string $version) : static
Parameters
- $version : string
Return values
staticupdateConfigValue()
Update existing value in config
public
updateConfigValue(string $name, string $value) : AbstractApplication
Parameters
- $name : string
- $value : string