50 if (!$checkFieldsResult->isSuccess())
52 $this->addErrors($checkFieldsResult->getErrors());
56 $propertyId = (int)$fields[
'PROPERTY_ID'];
57 unset($fields[
'PROPERTY_ID']);
59 $addResult = PropertyCatalogFeature::addFeatures($propertyId, [$fields]);
60 if (!$addResult->isSuccess())
62 $this->addErrors($addResult->getErrors());
66 $propertyFeatureId = current($addResult->getData());
67 return [
'PRODUCT_PROPERTY_FEATURE' => $this->
get($propertyFeatureId)];
111 $existsResult = $this->
exists($id);
112 if (!$existsResult->isSuccess())
114 $this->addErrors($existsResult->getErrors());
119 if (!$checkFieldsResult->isSuccess())
121 $this->addErrors($checkFieldsResult->getErrors());
125 $propertyId = (int)$fields[
'PROPERTY_ID'];
126 unset($fields[
'PROPERTY_ID']);
127 $updateResult = PropertyCatalogFeature::updateFeatures($propertyId, [$fields]);
130 $this->addErrors($updateResult->getErrors());
134 return [
'PRODUCT_PROPERTY_FEATURE' => $this->
get($id)];