Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
IBlockDataService.php
1
<?php
2
3
namespace
Bitrix\Lists\Api\Service\IBlockService
;
4
5
use
Bitrix\Lists\Api\Data\IBlockService\IBlockElementToAdd
;
6
use
Bitrix\Lists\Api\Request\IBlockService\AddIBlockElementRequest
;
7
use
Bitrix\Lists\Api\Response\IBlockService\AddIBlockElementResponse
;
8
use
Bitrix\Main\ArgumentOutOfRangeException
;
9
use
Bitrix\Main\Error
;
10
11
final
class
IBlockDataService
12
{
13
public
function
getIBlockElementToAddObject
(
14
AddIBlockElementRequest
$request,
15
AddIBlockElementResponse
$response
16
): ?
IBlockElementToAdd
17
{
18
$elementToAdd =
null
;
19
try
20
{
21
$elementToAdd = IBlockElementToAdd::createFromRequest($request);
22
}
23
catch
(
ArgumentOutOfRangeException
$exception)
24
{
25
$response->
addError
(
new
Error
($exception->getMessage(), $exception->
getParameter
()));
26
}
27
28
return
$elementToAdd;
29
}
30
}
Bitrix\Lists\Api\Data\IBlockService\IBlockElementToAdd
Definition
IBlockElementToAdd.php:12
Bitrix\Lists\Api\Request\IBlockService\AddIBlockElementRequest
Definition
AddIBlockElementRequest.php:6
Bitrix\Lists\Api\Response\IBlockService\AddIBlockElementResponse
Definition
AddIBlockElementResponse.php:8
Bitrix\Lists\Api\Service\IBlockService\IBlockDataService
Definition
IBlockDataService.php:12
Bitrix\Lists\Api\Service\IBlockService\IBlockDataService\getIBlockElementToAddObject
getIBlockElementToAddObject(AddIBlockElementRequest $request, AddIBlockElementResponse $response)
Definition
IBlockDataService.php:13
Bitrix\Main\ArgumentException\getParameter
getParameter()
Definition
exception.php:43
Bitrix\Main\ArgumentOutOfRangeException
Definition
exception.php:67
Bitrix\Main\Error
Definition
error.php:14
Bitrix\Main\Result\addError
addError(Error $error)
Definition
result.php:50
Bitrix\Lists\Api\Service\IBlockService
Definition
AccessService.php:3
modules
lists
lib
Api
Service
IBlockService
IBlockDataService.php
Создано системой
1.10.0