62 if (!$checkFieldsResult->isSuccess())
64 $this->addErrors($checkFieldsResult->getErrors());
69 $propertyType = $property[
'PROPERTY_TYPE'];
70 if ($propertyType !== PropertyTable::TYPE_LIST)
72 $this->addError(
new Error(
'Only list properties are supported'));
77 $application->ResetException();
79 $addResult = PropertyEnumerationTable::add($fields);
80 if (!$addResult->isSuccess())
82 $this->addErrors($addResult->getErrors());
86 return [
'PRODUCT_PROPERTY_ENUM' => $this->
get($addResult->getId())];
96 $existsResult = $this->
exists($id);
97 if (!$existsResult->isSuccess())
99 $this->addErrors($existsResult->getErrors());
104 if (!$checkFieldsResult->isSuccess())
106 $this->addErrors($checkFieldsResult->getErrors());
110 $propertyId = $this->
get($id)[
'PROPERTY_ID'];
111 $updateResult = PropertyEnumerationTable::update([
113 'PROPERTY_ID' => $propertyId,
117 $this->addErrors($updateResult->getErrors());
121 return [
'PRODUCT_PROPERTY_ENUM' => $this->
get($id)];
130 $existsResult = $this->
exists($id);
131 if (!$existsResult->isSuccess())
133 $this->addErrors($existsResult->getErrors());
137 $propertyId = $this->
get($id)[
'PROPERTY_ID'];
138 $deleteResult = PropertyEnumerationTable::delete([
140 'PROPERTY_ID' => $propertyId,
145 $this->addErrors($deleteResult->getErrors());
149 return $deleteResult->isSuccess();