<?php declare(strict_types = 0);
class CControllerCorrelationEdit extends CController {
private $correlation = [];
protected function init() {
$this->disableSIDValidation();
protected function checkInput() {
'correlationid' => 'db correlation.correlationid',
'name' => 'db correlation.name',
'description' => 'db correlation.description',
'evaltype' => 'db correlation.evaltype|in '.implode(',', [CONDITION_EVAL_TYPE_AND_OR, CONDITION_EVAL_TYPE_AND, CONDITION_EVAL_TYPE_OR, CONDITION_EVAL_TYPE_EXPRESSION]),
'status' => 'db correlation.status|in '.implode(',', [ZBX_CORRELATION_ENABLED, ZBX_CORRELATION_DISABLED]),
'formula' => 'db correlation.formula',
'op_close_new' => 'in 1',
'op_close_old' => 'in 1',
'form_refresh' => 'int32'
$ret = $this->validateInput($fields);
$this->setResponse(new CControllerResponseFatal());
protected function checkPermissions() {
if (!$this->checkAccess(CRoleHelper::UI_CONFIGURATION_EVENT_CORRELATION)) {
if ($this->hasInput('correlationid') && !$this->hasInput('form_refresh')) {
$correlations = API::Correlation()->get([
'output' => ['correlationid', 'name', 'description', 'status'],
'selectFilter' => ['formula', 'conditions', 'evaltype'],
'selectOperations' => ['type'],
'correlationids' => $this->getInput('correlationid'),