| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace ThurData\Servers\KerioEmail\Core\UI\Traits;
- use function \ThurData\Servers\KerioEmail\Core\Helper\di;
- /**
- * WhmcsParams related functions
- *
- * @autor ThurData <info@thurdata.ch>
- */
- trait WhmcsParams
- {
- /**
- *
- * @var \ThurData\Servers\KerioEmail\Core\Helper\WhmcsParams
- */
- private $whmcsParams = null;
- public function initWhmcsParams()
- {
- if ($this->whmcsParams === null)
- {
- logModuleCall(
- 'kerioEmail',
- __FUNCTION__,
- $this,
- 'Debug Home',
- di('whmcsParams')
- );
- $this->whmcsParams = di('whmcsParams');
- }
- }
- protected function getWhmcsParamByKey($key, $default = false)
- {
- $this->initWhmcsParams();
- return $this->whmcsParams->getParamByKey($key, $default);
- }
- public function getWhmcsParamsByKeys(array $keys = [], $default = false)
- {
- $selectedParams = [];
- foreach ($keys as $key)
- {
- $selectedParams[$key] = $this->getWhmcsParamByKey($key, $default);
- }
- return $selectedParams;
- }
- }
|