2021-11-02 16:01:24 +08:00
|
|
|
<?php
|
|
|
|
|
|
2022-03-15 18:05:33 +08:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2021-11-02 16:01:24 +08:00
|
|
|
namespace ZM\Module;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @since 2.6
|
|
|
|
|
*/
|
|
|
|
|
abstract class ModuleBase
|
|
|
|
|
{
|
2022-05-04 21:03:59 +08:00
|
|
|
/** @var string 模块名称 */
|
2021-11-02 16:01:24 +08:00
|
|
|
protected $module_name;
|
|
|
|
|
|
2022-05-04 21:03:59 +08:00
|
|
|
/** @var array 事件列表 */
|
2021-11-02 16:01:24 +08:00
|
|
|
protected $events = [];
|
|
|
|
|
|
2022-05-04 21:03:59 +08:00
|
|
|
/**
|
|
|
|
|
* @param string $module_name 模块名称
|
|
|
|
|
*/
|
|
|
|
|
public function __construct(string $module_name)
|
2022-03-15 18:05:33 +08:00
|
|
|
{
|
2021-11-02 16:01:24 +08:00
|
|
|
$this->module_name = $module_name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2022-05-04 21:03:59 +08:00
|
|
|
* 获取模块名称
|
|
|
|
|
* @return string
|
2021-11-02 16:01:24 +08:00
|
|
|
*/
|
2022-03-15 18:05:33 +08:00
|
|
|
public function getModuleName()
|
|
|
|
|
{
|
2021-11-02 16:01:24 +08:00
|
|
|
return $this->module_name;
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-04 21:03:59 +08:00
|
|
|
/**
|
|
|
|
|
* 获取事件列表
|
|
|
|
|
*/
|
2022-03-15 18:05:33 +08:00
|
|
|
public function getEvents(): array
|
|
|
|
|
{
|
2021-11-02 16:01:24 +08:00
|
|
|
return $this->events;
|
|
|
|
|
}
|
2022-03-15 18:05:33 +08:00
|
|
|
}
|