function restoreParameterTable = syncOverrideStatusOfSldvParamTable(cs)
%

%   Copyright 2021 The MathWorks, Inc.

restoreParameterTable = false;
% When restoreParameterTable is true, the parameter table is supposed to be
% emptied
try
    if cs.isParameterOverridden('DVParameterNames')
        % We override the parameter table entries if user overrides 'DVParameterNames'
        if ~cs.isParameterOverridden('DVParameterUseInAnalysis')
            cs.enableOverride('DVParameterUseInAnalysis');
        end
        if ~cs.isParameterOverridden('DVParameterConstraints')
            cs.enableOverride('DVParameterConstraints');
        end
    else
        % We restore the parameter table entries if user restores 'DVParameterNames'
        if cs.isParameterOverridden('DVParameterUseInAnalysis')
            cs.restore('DVParameterUseInAnalysis');
        end
        if cs.isParameterOverridden('DVParameterConstraints')
            cs.restore('DVParameterConstraints');
        end
        restoreParameterTable = true;
    end
catch ME %#ok<NASGU> 
    % Do not show any warnings
    % We use this section for debugging. We can't think of any reason why
    % we will reach here from source. But, We do need this section if we
    % introduce any dependencies on these parameters in the future.
end
end
