Files
zhamao-framework/src/ZM/Module/ModuleBase.php

43 lines
679 B
PHP
Raw Normal View History

2021-11-02 16:01:24 +08:00
<?php
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)
{
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
*/
public function getModuleName()
{
2021-11-02 16:01:24 +08:00
return $this->module_name;
}
2022-05-04 21:03:59 +08:00
/**
* 获取事件列表
*/
public function getEvents(): array
{
2021-11-02 16:01:24 +08:00
return $this->events;
}
}