private function hasOtherConditionField(ConditionGroup $conditionGroup, string $source, array $fieldNames, &$foundField = null) : bool {
        $result = false;
        $conditions = &$conditionGroup->getConditions();
        foreach ($conditions as $key=>&$condition) {
            if ($condition->type == ConditionType::GROUP) {
                $result = $this->hasOtherConditionField($condition->group, $source, $fieldNames, $foundField);
                if ($result) {
                    break;
                }
            } else if ($condition->type == ConditionType::RAW) {
                $result = true;
                $foundField = 'RAW';
                break;
            } else {
                $field = $condition->field;
                $tablePos = stripos($field, "$source.");
                if($tablePos === 0) {
                    $field = substr($field, strlen($source)+1);
                }
                if (!$this->fieldInList($field, $fieldNames)) {
                    $result = true;
                    $foundField = $field;
                    break;
                }

                if ($condition->operator == ConditionOperator::EQUALS_FIELD) {
                    $field = $condition->value;
                    $tablePos = stripos($field, "$source.");
                    if($tablePos === 0) {
                        $field = substr($field, strlen($source)+1);
                    }
                    if (!$this->fieldInList($field, $fieldNames)) {
                        $result = true;
                        $foundField = $field;
                        break;
                    }
                }
            }
        }
        return $result;
    }