3namespace Bitrix\Catalog\Controller;
5use Bitrix\Catalog\Access\ActionDictionary;
6use Bitrix\Catalog\MeasureTable;
8use Bitrix\Main\ORM\Data\DataManager;
10use Bitrix\Rest\Event\EventBindInterface;
37 $r = $this->existsByFilter([
40 if ($r->isSuccess() ===
false)
54 $r->addError($this->getErrorDublicateFieldCode());
57 $this->addErrors($r->getErrors());
73 $existsResult = $this->
exists($id);
74 if (!$existsResult->isSuccess())
76 $this->addErrors($existsResult->getErrors());
84 $r = parent::update($id,
$fields);
91 $this->addErrors($r->getErrors());
106 $existsResult = $this->
exists($id);
107 if (!$existsResult->isSuccess())
109 $this->addErrors($existsResult->getErrors());
114 $r = parent::delete($id);
121 $this->addErrors($r->getErrors());
149 if (
$fields[
'IS_DEFAULT'] ===
'Y')
151 $exist = $this->existsByFilter([
152 '=IS_DEFAULT' =>
$fields[
'IS_DEFAULT'],
154 if ($exist->isSuccess())
156 $r->addError(
new Error(
'default value can be set once [isDefault]', 200600000010));
172 if (!$this->accessController->check(ActionDictionary::ACTION_STORE_VIEW))
186 $this->accessController->check(ActionDictionary::ACTION_CATALOG_READ)
187 || $this->accessController->check(ActionDictionary::ACTION_STORE_VIEW)
200 $existsResult = $this->existsByFilter([
204 if ($existsResult->isSuccess())
207 $result->addError($this->getErrorDublicateFieldCode());
216 private function getErrorDublicateFieldCode():
Error
218 return new Error(
'Duplicate entry for key [code]', 200600000000);
getErrorModifyAccessDenied()
getErrorReadAccessDenied()
const MEASURE_ENTITY_NOT_EXISTS
checkModifyPermissionEntity()
checkReadPermissionEntity()
getErrorCodeEntityNotExists()
updateAction(int $id, array $fields)
checkDefaultValue(array $fields)
checkMeasureBeforeUpdate(int $id, array $fields)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)