mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34: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\Exception\NotFoundError;
|
||||||
use Icinga\Module\Director\Core\CoreApi;
|
use Icinga\Module\Director\Core\CoreApi;
|
||||||
use Icinga\Module\Director\Db;
|
use Icinga\Module\Director\Db;
|
||||||
|
use Icinga\Module\Director\IcingaConfig\IcingaConfig;
|
||||||
use Icinga\Module\Director\Monitoring;
|
use Icinga\Module\Director\Monitoring;
|
||||||
use Icinga\Module\Director\Objects\IcingaEndpoint;
|
use Icinga\Module\Director\Objects\IcingaEndpoint;
|
||||||
use Icinga\Module\Director\Web\Form\FormLoader;
|
use Icinga\Module\Director\Web\Form\FormLoader;
|
||||||
@ -31,6 +32,8 @@ abstract class ActionController extends Controller
|
|||||||
/** @var Monitoring */
|
/** @var Monitoring */
|
||||||
private $monitoring;
|
private $monitoring;
|
||||||
|
|
||||||
|
protected $icingaConfig;
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
if ($this->getRequest()->isApiRequest()) {
|
if ($this->getRequest()->isApiRequest()) {
|
||||||
@ -305,4 +308,12 @@ abstract class ActionController extends Controller
|
|||||||
|
|
||||||
return $this->monitoring;
|
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