Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
AverageTemplateDurationToGet.php
1
<?php
2
3
namespace
Bitrix\Lists\Api\Data\ServiceFactory
;
4
5
use
Bitrix\Lists\Api\Data\Data
;
6
use
Bitrix\Lists\Api\Request\ServiceFactory\GetAverageIBlockTemplateDurationRequest
;
7
use
Bitrix\Main\ArgumentException
;
8
use
Bitrix\Main\ArgumentOutOfRangeException
;
9
use
Bitrix\Main\Loader
;
10
11
final
class
AverageTemplateDurationToGet
extends
Data
12
{
13
private
int
$iBlockId;
14
private
int
$autoExecuteType;
15
16
private
function
__construct(
17
int
$iBlockId,
18
int
$autoExecuteType
19
)
20
{
21
$this->iBlockId = $iBlockId;
22
$this->autoExecuteType = $autoExecuteType;
23
}
24
32
public
static
function
createFromRequest
($request): self
33
{
34
$iBlockId =
self::validateId
($request->iBlockId);
35
if
($iBlockId ===
null
|| $iBlockId === 0)
36
{
37
throw
new
ArgumentOutOfRangeException
(
'iBlockId'
, 1,
null
);
38
}
39
40
$autoExecuteType = $request->autoExecuteType;
41
if
(!Loader::includeModule(
'bizproc'
) || \CBPDocumentEventType::out($autoExecuteType) ===
''
)
42
{
43
throw
new
ArgumentException
(
'Invalid value for $autoExecuteType'
,
'autoExecuteType'
);
44
}
45
46
return
new
self
($iBlockId, $autoExecuteType);
47
}
48
52
public
function
getIBlockId
(): int
53
{
54
return
$this->iBlockId;
55
}
56
60
public
function
getAutoExecuteType
(): int
61
{
62
return
$this->autoExecuteType;
63
}
64
}
Bitrix\Lists\Api\Data\Data
Definition
Data.php:6
Bitrix\Lists\Api\Data\Data\validateId
static validateId(int $id)
Definition
Data.php:9
Bitrix\Lists\Api\Data\ServiceFactory\AverageTemplateDurationToGet
Definition
AverageTemplateDurationToGet.php:12
Bitrix\Lists\Api\Data\ServiceFactory\AverageTemplateDurationToGet\createFromRequest
static createFromRequest($request)
Definition
AverageTemplateDurationToGet.php:32
Bitrix\Lists\Api\Data\ServiceFactory\AverageTemplateDurationToGet\getAutoExecuteType
getAutoExecuteType()
Definition
AverageTemplateDurationToGet.php:60
Bitrix\Lists\Api\Data\ServiceFactory\AverageTemplateDurationToGet\getIBlockId
getIBlockId()
Definition
AverageTemplateDurationToGet.php:52
Bitrix\Lists\Api\Request\ServiceFactory\GetAverageIBlockTemplateDurationRequest
Definition
GetAverageIBlockTemplateDurationRequest.php:6
Bitrix\Main\ArgumentException
Definition
exception.php:34
Bitrix\Main\ArgumentOutOfRangeException
Definition
exception.php:67
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Lists\Api\Data\ServiceFactory
Definition
AverageTemplateDurationToGet.php:3
modules
lists
lib
Api
Data
ServiceFactory
AverageTemplateDurationToGet.php
Создано системой
1.10.0