diff --git a/library/Director/Objects/IcingaHost.php b/library/Director/Objects/IcingaHost.php index 08e9888d..8f50f12d 100644 --- a/library/Director/Objects/IcingaHost.php +++ b/library/Director/Objects/IcingaHost.php @@ -85,6 +85,8 @@ class IcingaHost extends IcingaObject protected $supportsFields = true; + protected $supportsChoices = true; + protected $supportedInLegacy = true; /** @var HostGroupMembershipResolver */ diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php index 19ab826a..f6eed083 100644 --- a/library/Director/Objects/IcingaObject.php +++ b/library/Director/Objects/IcingaObject.php @@ -51,6 +51,9 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer /** @var bool Whether Sets of object can be defined */ protected $supportsSets = false; + /** @var bool Whether this Object supports template-based Choices */ + protected $supportsChoices = false; + /** @var bool If the object is rendered in legacy config */ protected $supportedInLegacy = false; @@ -427,6 +430,16 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer return $this->supportsSets; } + /** + * Whether this object supports template-based Choices + * + * @return bool + */ + public function supportsChoices() + { + return $this->supportsChoices; + } + public function setAssignments($value) { return IcingaObjectLegacyAssignments::applyToObject($this, $value); diff --git a/library/Director/Objects/IcingaService.php b/library/Director/Objects/IcingaService.php index be92533c..929e377b 100644 --- a/library/Director/Objects/IcingaService.php +++ b/library/Director/Objects/IcingaService.php @@ -47,6 +47,7 @@ class IcingaService extends IcingaObject 'apply_for' => null, 'use_var_overrides' => null, 'assign_filter' => null, + 'template_choice_id' => null, ); protected $relations = array( @@ -57,6 +58,7 @@ class IcingaService extends IcingaObject 'check_period' => 'IcingaTimePeriod', 'command_endpoint' => 'IcingaEndpoint', 'zone' => 'IcingaZone', + 'template_choice' => 'IcingaTemplateChoiceService', ); protected $booleans = array( @@ -88,6 +90,8 @@ class IcingaService extends IcingaObject protected $supportsSets = true; + protected $supportsChoices = true; + protected $supportedInLegacy = true; protected $keyName = array('host_id', 'service_set_id', 'object_name');