diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php index c6f5c4a7..4181be6a 100644 --- a/library/Director/Objects/IcingaObject.php +++ b/library/Director/Objects/IcingaObject.php @@ -818,6 +818,11 @@ return ''; return $this->renderZoneProperty($this->zone_id); } + protected function renderCustomExtensions() + { + return ''; + } + protected function renderObjectHeader() { return sprintf( @@ -837,6 +842,7 @@ return ''; $this->renderRanges(), $this->renderArguments(), $this->renderGroups(), + $this->renderCustomExtensions(), $this->renderCustomVars(), $this->renderSuffix() )); diff --git a/library/Director/Objects/IcingaZone.php b/library/Director/Objects/IcingaZone.php index c4fa101d..5042079c 100644 --- a/library/Director/Objects/IcingaZone.php +++ b/library/Director/Objects/IcingaZone.php @@ -27,6 +27,28 @@ class IcingaZone extends IcingaObject protected $supportsImports = true; + protected function renderCustomExtensions() + { + $endpoints = $this->listEndpoints(); + if (empty($endpoints)) { + return ''; + } + + return c::renderKeyValue('endpoints', c::renderArray($endpoints)); + } + + // TODO: Move this away, should be prefetchable: + protected function listEndpoints() + { + $db = $this->getDb(); + $query = $db->select() + ->from('icinga_endpoint', 'object_name') + ->where('zone_id = ?', $this->id) + ->order('object_name'); + + return $db->fetchCol($query); + } + protected function renderParent_zone_id() { return $this->renderRelationProperty(