3namespace Bitrix\Lists\Api\Service\ServiceFactory;
5use Bitrix\Lists\Api\Data\ServiceFactory\AverageTemplateDurationToGet;
6use Bitrix\Lists\Api\Data\ServiceFactory\ElementToAdd;
7use Bitrix\Lists\Api\Data\ServiceFactory\ElementToGetDetailInfo;
8use Bitrix\Lists\Api\Data\ServiceFactory\ElementToUpdate;
9use Bitrix\Lists\Api\Request\ServiceFactory\AddElementRequest;
10use Bitrix\Lists\Api\Request\ServiceFactory\GetAverageIBlockTemplateDurationRequest;
11use Bitrix\Lists\Api\Request\ServiceFactory\GetElementDetailInfoRequest;
12use Bitrix\Lists\Api\Request\ServiceFactory\UpdateElementRequest;
13use Bitrix\Lists\Api\Response\ServiceFactory\AddElementResponse;
14use Bitrix\Lists\Api\Response\ServiceFactory\GetAverageIBlockTemplateDurationResponse;
15use Bitrix\Lists\Api\Response\ServiceFactory\GetElementDetailInfoResponse;
16use Bitrix\Lists\Api\Response\ServiceFactory\UpdateElementResponse;
17use Bitrix\Main\ArgumentException;
18use Bitrix\Main\ArgumentOutOfRangeException;
20use Bitrix\Main\Localization\Loc;
37 if ($parameter ===
'iBlockId')
39 $response->addError(self::getWrongIBlockError());
42 if ($parameter ===
'elementId')
44 $response->addError(self::getNegativeElementIdError());
47 if ($parameter ===
'sectionId')
49 $response->addError(self::getNegativeSectionIdError());
69 if ($parameter ===
'iBlockId')
71 $response->addError(self::getWrongIBlockError());
74 if ($parameter ===
'sectionId')
76 $response->addError(self::getNegativeSectionIdError());
79 if ($parameter ===
'createdBy')
81 $response->addError(self::getNegativeUserIdError());
93 $elementToUpdate =
null;
101 if ($parameter ===
'elementId')
103 $response->addError(self::getNegativeElementIdError());
106 if ($parameter ===
'iBlockId')
108 $response->addError(self::getWrongIBlockError());
111 if ($parameter ===
'sectionId')
113 $response->addError(self::getNegativeSectionIdError());
116 if ($parameter ===
'modifiedBy')
118 $response->addError(self::getNegativeUserIdError());
122 return $elementToUpdate;
137 $response->addError(self::getWrongIBlockError());
149 return new Error(Loc::getMessage(
'LISTS_LIB_API_DATA_SERVICE_ERROR_WRONG_IBLOCK'));
152 private static function getNegativeElementIdError():
Error
154 return new Error(Loc::getMessage(
'LISTS_LIB_API_DATA_SERVICE_ERROR_NEGATIVE_ELEMENT_ID'));
157 private static function getNegativeSectionIdError():
Error
159 return new Error(Loc::getMessage(
'LISTS_LIB_API_DATA_SERVICE_ERROR_NEGATIVE_SECTION_ID'));
162 private static function getNegativeUserIdError():
Error
164 return new Error(Loc::getMessage(
'LISTS_LIB_API_DATA_SERVICE_ERROR_NEGATIVE_CREATED_BY_ID'));
if(!Loader::includeModule('catalog')) if(!AccessController::getCurrent() ->check(ActionDictionary::ACTION_PRICE_EDIT)) if(!check_bitrix_sessid()) $request
static createFromRequest($request)
static createFromRequest($request)
static createFromRequest(GetElementDetailInfoRequest $request)
static createFromRequest($request)
static getWrongIBlockError()
getElementToGetDetailInfoObject(GetElementDetailInfoRequest $request, GetElementDetailInfoResponse $response)
getElementToAddObject(AddElementRequest $request, AddElementResponse $response)
getElementToUpdateObject(UpdateElementRequest $request, UpdateElementResponse $response)
getAverageTemplateDurationToGetObject(GetAverageIBlockTemplateDurationRequest $request, GetAverageIBlockTemplateDurationResponse $response,)