ImportRunBasedPurgeStrategy: do not fetch no rows

This commit is contained in:
Thomas Gelf 2016-07-19 06:18:52 +02:00
parent 15acbb5290
commit e58c31ab63
1 changed files with 7 additions and 3 deletions

View File

@ -66,6 +66,10 @@ class ImportRunBasedPurgeStrategy extends PurgeStrategy
$result = $db->fetchCol($query);
if (empty($result)) {
return array();
}
if ($rule->object_type === 'service') {
$pattern = $rule->getSourceKeyPattern();
$columns = SyncUtils::getRootVariables(
@ -78,10 +82,10 @@ class ImportRunBasedPurgeStrategy extends PurgeStrategy
}
}
if ($result) {
return array_combine($result, $result);
} else {
if (empty($result)) {
return array();
}
return array_combine($result, $result);
}
}