Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
AverageTemplateDurationToGet.php
1<?php
2
4
10
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}
static validateId(int $id)
Definition Data.php:9