% 
% CALL:
%        varargout = setPropertyValue(inputs, ...
%                                     input_names, ...
%                                     objectClass, ...
%                                     callerIsMethod, ...
%                                     propName, ...
%                                     setterFcn, ...
%                                     copy, ...
%                                     getInfo)
% 
% 
function varargout = setPropertyValue(varargin)

    
  % get inputs
  callerIsMethod = varargin{end-4};
  propName       = varargin{end-3};
  getInfo        = varargin{end};
  
  % Check if this is a call for parameters
  if utils.helper.isinfocall(varargin{1:end-6})
    varargout{1} = getInfo(varargin{3});
    return
  end
  
  % call super class method
  [objects, values, pls, obj_invars] = setPropertyValue@ltpda_uo(varargin{:});
    
  % Combine input plists and default PLIST
  ii = getInfo('Default');
  pls = applyDefaults(ii.plists, pls);

  for jj = 1:numel(objects)
    % Add history if needed
    if ~callerIsMethod
      if isempty(values)
        plh = pls;
      else
        plh = pls.pset(propName, values{jj});
      end
      objects(jj).addHistory(getInfo('None'), plh, obj_invars(jj), objects(jj).hist);
    end
  end
  
  % Set output
  varargout{1} = objects;
end
% END