| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- /**
- * Class ModuleConfigurationHandler
- * User: ThurData
- * Date: 2019-11-19
- * Time: 08:21
- * @package ThurData\Servers\KerioEmail\App\Traits
- */
- namespace ThurData\Servers\KerioEmail\App\Traits;
- use ThurData\Servers\KerioEmail\Core\Configuration\Data;
- trait ModuleConfigurationHandler
- {
- /**
- *
- * @var Data
- */
- protected $moduleData;
- /**
- *
- * @return Data
- */
- public function getModuleData()
- {
- return $this->moduleData;
- }
- /**
- *
- * @param bool $reload
- * @return Data|null
- */
- public function loadModuleData($reload = false)
- {
- /**
- * unset data if need reload
- */
- if($reload)
- {
- $this->moduleData = null;
- }
- /**
- * load data
- */
- if(!$this->moduleData)
- {
- $this->moduleData = new Data();
- }
- /**
- * return data
- */
- return $this->moduleData;
- }
- }
|