• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/services/base/usergrouprestriction.php
  • Класс: BitrixSaleServicesBaseUserGroupRestriction
  • Вызов: UserGroupRestriction::prepareParamsForSaving
static function prepareParamsForSaving(array $params = array(), $entityId = 0)
{
	$entityId = (int)$entityId;
	$entityTypeId = (int)static::getEntityTypeId();
	UserGroupRestrictionTable::deleteByEntity($entityTypeId, $entityId);

	if(is_array($params['GROUP_IDS']) && !empty($params['GROUP_IDS']))
	{
		foreach($params['GROUP_IDS'] as $groupId)
		{
			UserGroupRestrictionTable::add([
				'ENTITY_TYPE_ID' => $entityTypeId,
				'ENTITY_ID' => $entityId,
				'GROUP_ID' => (int)$groupId
			]);
		}
	}

	return [];
}