mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 01:04:12 +02:00
ActionController: Add load helper for IcingaConfig
This commit is contained in:
parent
3f53285566
commit
e368b32ec6
@ -8,6 +8,7 @@ use Icinga\Exception\ConfigurationError;
|
||||
use Icinga\Exception\NotFoundError;
|
||||
use Icinga\Module\Director\Core\CoreApi;
|
||||
use Icinga\Module\Director\Db;
|
||||
use Icinga\Module\Director\IcingaConfig\IcingaConfig;
|
||||
use Icinga\Module\Director\Monitoring;
|
||||
use Icinga\Module\Director\Objects\IcingaEndpoint;
|
||||
use Icinga\Module\Director\Web\Form\FormLoader;
|
||||
@ -31,6 +32,8 @@ abstract class ActionController extends Controller
|
||||
/** @var Monitoring */
|
||||
private $monitoring;
|
||||
|
||||
protected $icingaConfig;
|
||||
|
||||
public function init()
|
||||
{
|
||||
if ($this->getRequest()->isApiRequest()) {
|
||||
@ -305,4 +308,12 @@ abstract class ActionController extends Controller
|
||||
|
||||
return $this->monitoring;
|
||||
}
|
||||
|
||||
protected function IcingaConfig() {
|
||||
if ($this->icingaConfig === null) {
|
||||
$this->icingaConfig = new IcingaConfig($this->db);
|
||||
}
|
||||
|
||||
return $this->icingaConfig;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user