74 lines
1.7 KiB
PHP
74 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace KTXF\Module;
|
|
|
|
abstract class ModuleInstanceAbstract implements ModuleInstanceInterface
|
|
{
|
|
// mandatory methods that must be implemented by each concrete module
|
|
abstract public function handle(): string;
|
|
|
|
abstract public function version(): string;
|
|
|
|
abstract public function label(): string;
|
|
|
|
abstract public function description(): string;
|
|
|
|
abstract public function author(): string;
|
|
|
|
// optional methods that can be overridden by specific modules
|
|
public function install(): void
|
|
{
|
|
// Override in specific modules if needed
|
|
}
|
|
|
|
public function uninstall(): void
|
|
{
|
|
// Override in specific modules if needed
|
|
}
|
|
|
|
public function enable(): void
|
|
{
|
|
// Override in specific modules if needed
|
|
}
|
|
|
|
public function disable(): void
|
|
{
|
|
// Override in specific modules if needed
|
|
}
|
|
|
|
public function upgrade(): void
|
|
{
|
|
// Override in specific modules if needed
|
|
}
|
|
|
|
public function boot(): void
|
|
{
|
|
// Override in specific modules if needed
|
|
}
|
|
|
|
/**
|
|
* Permissions provided by this module
|
|
*
|
|
* @return array Permission definitions with metadata
|
|
*
|
|
* @example
|
|
* return [
|
|
* 'user_manager.users.view' => [
|
|
* 'label' => 'View Users',
|
|
* 'description' => 'View user list and details',
|
|
* 'group' => 'User Management'
|
|
* ],
|
|
* 'user_manager.users.*' => [
|
|
* 'label' => 'Full User Management',
|
|
* 'description' => 'All user management permissions',
|
|
* 'group' => 'User Management'
|
|
* ]
|
|
* ];
|
|
*/
|
|
public function permissions(): array
|
|
{
|
|
return [];
|
|
}
|
|
|
|
}
|