Documentation

save

public static function
\Bitrix\Sale\Services\Base\Restriction::save(
	array $fields,
	$restrictionId = 0
);

Method adds/updates limits for service. Static method.

Parameters

ParameterDescriptionVersion
$fieldsLimit parameters. Contains fields:
  • SERVICE_ID – service identifier;
  • SERVICE_TYPE – service type;
  • PARAMS – limit parameters.
$restrictionIdLimit ID (indicated in case, when you need to update existing limit, not create a new one).

Examples

 
public static function save(array $fields, $restrictionId = 0)
{
	$fields["CLASS_NAME"] = '\\'.get_called_class();

	if($restrictionId > 0)
	{
		$res = ServiceRestrictionTable::update($restrictionId, $fields);
	}
	else
	{
		$res = ServiceRestrictionTable::add($fields);
	}

	return $res;
}


© «Bitrix24», 2001-2024
Up