PHP Class Inpsyde\MultilingualPress\Module\NetworkOptionModuleManager

Since: 3.0.0
Inheritance: implements Inpsyde\MultilingualPress\Module\ModuleManager
Datei anzeigen Open project: inpsyde/multilingual-press

Public Methods

Method Description
__construct ( string $option ) Constructor. Sets up the properties.
activate_module ( string $id ) : Module Activates the module with the given ID.
deactivate_module ( string $id ) : Module Deactivates the module with the given ID.
get_module ( string $id ) : Module Returns the module with the given ID.
get_modules ( integer $state = ModuleManager::MODULE_STATE_ALL ) : Module[] Returns all modules with the given state.
has_module ( string $id ) : boolean Checks if the module with the given ID has been registered.
has_modules ( ) : boolean Checks if any modules have been registered.
is_module_active ( string $id ) : boolean Checks if the module with the given ID is active.
register_module ( Module $module ) : boolean Registers the given module.
save_modules ( ) : boolean Saves the modules persistently.
unregister_module ( string $id ) : Module[] Unregisters the module with the given.

Method Details

__construct() public method

Constructor. Sets up the properties.
Since: 3.0.0
public __construct ( string $option )
$option string The name of the network option used for storage.

activate_module() public method

Activates the module with the given ID.
Since: 3.0.0
public activate_module ( string $id ) : Module
$id string Module ID.
return Module Module object.

deactivate_module() public method

Deactivates the module with the given ID.
Since: 3.0.0
public deactivate_module ( string $id ) : Module
$id string Module ID.
return Module Module object.

get_module() public method

Returns the module with the given ID.
Since: 3.0.0
public get_module ( string $id ) : Module
$id string Module ID.
return Module Module object.

get_modules() public method

Returns all modules with the given state.
Since: 3.0.0
public get_modules ( integer $state = ModuleManager::MODULE_STATE_ALL ) : Module[]
$state integer Optional. State of the modules. Defaults to all modules.
return Module[] Array of module objects.

has_module() public method

Checks if the module with the given ID has been registered.
Since: 3.0.0
public has_module ( string $id ) : boolean
$id string Module ID.
return boolean Whether or not the module with the given ID has been registered.

has_modules() public method

Checks if any modules have been registered.
Since: 3.0.0
public has_modules ( ) : boolean
return boolean Whether or not any modules have been registered.

is_module_active() public method

Checks if the module with the given ID is active.
Since: 3.0.0
public is_module_active ( string $id ) : boolean
$id string Module ID.
return boolean Whether or not the module with the given ID is active.

register_module() public method

Registers the given module.
Since: 3.0.0
public register_module ( Module $module ) : boolean
$module Module Module object.
return boolean Whether or not the module is active.

save_modules() public method

Saves the modules persistently.
Since: 3.0.0
public save_modules ( ) : boolean
return boolean Whether or not the modules were saved successfully.

unregister_module() public method

Unregisters the module with the given.
Since: 3.0.0
public unregister_module ( string $id ) : Module[]
$id string Module ID.
return Module[] Array of all registered module objects.