35 $application->ResetException();
37 $fields[
'USER_GROUP'] = $fields[
'USER_GROUP_BUY'] = [self::USER_GROUP_ADMINS, self::USER_GROUP_ALL_USERS];
39 $addResult = \CCatalogGroup::Add($fields);
42 if ($application->GetException())
44 $this->addError(
new Error($application->GetException()->GetString()));
48 $this->addError(
new Error(
'Error adding price type'));
53 return [
'PRICE_TYPE' => $this->
get($addResult)];
63 $existsResult = $this->
exists($id);
64 if (!$existsResult->isSuccess())
66 $this->addErrors($existsResult->getErrors());
71 $application->ResetException();
73 $updateResult = \CCatalogGroup::Update($id, $fields);
76 if ($application->GetException())
78 $this->addError(
new Error($application->GetException()->GetString()));
82 $this->addError(
new Error(
'Error updating price type'));
87 return [
'PRICE_TYPE' => $this->
get($id)];
96 $existsResult = $this->
exists($id);
97 if (!$existsResult->isSuccess())
99 $this->addErrors($existsResult->getErrors());
104 $application->ResetException();
106 $deleteResult = \CCatalogGroup::Delete($id);
109 if ($application->GetException())
111 $this->addError(
new Error($application->GetException()->GetString()));
115 $this->addError(
new Error(
'Error deleting price type'));