save
public static function \Bitrix\Sale\Services\Base\Restriction::save( array $fields, $restrictionId = 0 );
Method adds/updates limits for service. Static method.
Parameters
Parameter | Description | Version |
---|---|---|
$fields | Limit parameters. Contains fields:
| |
$restrictionId | Limit 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