mirror of
https://github.com/Aviortheking/DeltaCMS.git
synced 2025-04-24 11:52:13 +00:00
Added Abstract module
This commit is contained in:
parent
b951eb2716
commit
d0af5fda5f
46
src/DeltaCMS/Module/AbstractModule.php
Normal file
46
src/DeltaCMS/Module/AbstractModule.php
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace DeltaCMS\Module;
|
||||||
|
|
||||||
|
use DeltaCMS\Module\Config\Config;
|
||||||
|
use DeltaCMS\Module\Config\ConfigInterface;
|
||||||
|
use DeltaCMS\DeltaCMS;
|
||||||
|
|
||||||
|
abstract class AbstractModule implements ModuleInterface
|
||||||
|
{
|
||||||
|
/** @var \DeltaCMS\Logger $logger */
|
||||||
|
protected $logger;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->logger = DeltaCMS::getInstance()->getLogger();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function enable(): bool
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update(ConfigInterface $config = null): ConfigInterface
|
||||||
|
{
|
||||||
|
return new Config($config);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function disable()
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getName(): string
|
||||||
|
{
|
||||||
|
$name = explode("\\", get_class($this));
|
||||||
|
$name = $name[count($name) - 1];
|
||||||
|
|
||||||
|
return $name;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user