<?php

class CustomConditionSetter extends BaseComplianceSetter
{
    public function setCondition(array &$condition, array $data = [])
    {
        $rule = $condition['rules'];
        if (!isset($rule['sql'])) {
            throw new Exception("Custom condition `{$condition['name']}` is missing rule's sql");
        }
        $condition['customConditions'] = [
            'sql' => $rule['sql'],
        ];
    }
}
