phpBB API Documentation
Class

phpbb\module\module_manager

class module_manager

Methods

__construct(driver_interface $cache, driver_interface $db, manager $ext_manager, string $modules_table, string $phpbb_root_path, string $php_ext)

Constructor

array get_module_row(int $module_id, string $module_class)

Get row for specified module

array get_module_infos(string $module_class, string $module = '', bool $use_all_available = false)

Get available module information from module files

array get_module_branch(int $module_id, string $module_class, string $type = 'all', bool $include_module = true)

Get module branch

remove_cache_file(string $module_class)

Remove modules cache file

update_module_data(array $module_data)

Update/Add module

move_module(int $from_module_id, int $to_parent_id, string $module_class)

Move module around the tree

delete_module(int $module_id, string $module_class)

Remove module from tree

string move_module_by(array $module_row, string $module_class, string $action = 'move_up', int $steps = 1)

Move module position by $steps up/down

Details

at line 61
public __construct(driver_interface $cache, driver_interface $db, manager $ext_manager, string $modules_table, string $phpbb_root_path, string $php_ext)

Constructor

Parameters

driver_interface $cache Cache driver
driver_interface $db Database driver
manager $ext_manager Extension manager
string $modules_table Module database table's name
string $phpbb_root_path Path to phpBB's root
string $php_ext Extension of PHP files

at line 81
public array get_module_row(int $module_id, string $module_class)

Get row for specified module

Parameters

int $module_id ID of the module
string $module_class Class of the module (acp, ucp, mcp etc...)

Return Value

array Array of data fetched from the database

Exceptions

module_not_found_exception When there is no module with $module_id

at line 111
public array get_module_infos(string $module_class, string $module = '', bool $use_all_available = false)

Get available module information from module files

Parameters

string $module_class Class of the module (acp, ucp, mcp etc...)
string $module ID of module
bool $use_all_available Use all available instead of just all enabled extensions

Return Value

array Array with module information gathered from module info files.

at line 184
public array get_module_branch(int $module_id, string $module_class, string $type = 'all', bool $include_module = true)

Get module branch

Parameters

int $module_id ID of the module
string $module_class Class of the module (acp, ucp, mcp etc...)
string $type Type of branch (Expected values: all, parents or children)
bool $include_module Whether or not to include the specified module with $module_id

Return Value

array Returns an array containing the modules in the specified branch type.

at line 233
public remove_cache_file(string $module_class)

Remove modules cache file

Parameters

string $module_class Class of the module (acp, ucp, mcp etc...)

at line 248
public update_module_data(array $module_data)

Update/Add module

Parameters

array $module_data The module data

Exceptions

module_not_found_exception When parent module or the category is not exist

at line 346
public move_module(int $from_module_id, int $to_parent_id, string $module_class)

Move module around the tree

Parameters

int $from_module_id ID of the current parent module
int $to_parent_id ID of the target parent module
string $module_class Class of the module (acp, ucp, mcp etc...)

Exceptions

module_not_found_exception If the module specified to move modules from does not have any children.

at line 438
public delete_module(int $module_id, string $module_class)

Remove module from tree

Parameters

int $module_id ID of the module to delete
string $module_class Class of the module (acp, ucp, mcp etc...)

Exceptions

module_exception When the specified module cannot be removed

at line 487
public string move_module_by(array $module_row, string $module_class, string $action = 'move_up', int $steps = 1)

Move module position by $steps up/down

Parameters

array $module_row Array of module data
string $module_class Class of the module (acp, ucp, mcp etc...)
string $action Direction of moving (valid values: moveup or movedown)
int $steps Number of steps to move module

Return Value

string Returns the language name of the module

Exceptions

module_not_found_exception When the specified module does not exists