SyncRule: initialize hasServiceSet

This commit is contained in:
Thomas Gelf 2016-12-13 13:51:41 +01:00
parent d2adc1b4ec
commit 58a64cee78

View File

@ -262,6 +262,7 @@ class SyncRule extends DbObject
if ($this->get('object_type') === 'service') { if ($this->get('object_type') === 'service') {
$hasHost = false; $hasHost = false;
$hasObjectName = false; $hasObjectName = false;
$hasServiceSet = false;
foreach ($this->getSyncProperties() as $key => $property) { foreach ($this->getSyncProperties() as $key => $property) {
if ($property->destination_field === 'host') { if ($property->destination_field === 'host') {
@ -284,8 +285,7 @@ class SyncRule extends DbObject
); );
$this->destinationKeyPattern = '${host}!${object_name}'; $this->destinationKeyPattern = '${host}!${object_name}';
} } elseif ($hasServiceSet !== false && $hasObjectName !== false) {
elseif ($hasServiceSet !== false && $hasObjectName !== false) {
$this->hasCombinedKey = true; $this->hasCombinedKey = true;
$this->sourceKeyPattern = sprintf( $this->sourceKeyPattern = sprintf(
'%s!%s', '%s!%s',