1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
BaseScenario.php
См. документацию.
1<?php
2declare(strict_types=1);
3
5
6abstract class BaseScenario implements IScenario
7{
13 abstract public function getQuotaCalculateStep(): int;
14
18 public function getFirstStepId(): ?int
19 {
20 foreach ($this->getMap() as $id => $step)
21 {
22 return $id;
23 }
24
25 return null;
26 }
27
31 public function getNextStepId(int $stepId): ?int
32 {
33 $useNext = false;
34 foreach ($this->getMap() as $id => $step)
35 {
36 if ($useNext)
37 {
38 return $id;
39 }
40
41 if ($id === $stepId)
42 {
43 $useNext = true;
44 }
45 }
46
47 return null;
48 }
49
50 public function isLastStep(int $stepId): bool
51 {
52 $ids = array_keys($this->getMap());
53 $lastId = array_pop($ids);
54 if (!$lastId)
55 {
56 return false;
57 }
58
59 return $lastId === $stepId;
60 }
61
65 public function checkStep(?int $stepId): bool
66 {
67 if ($stepId === null)
68 {
69 return true;
70 }
71
72 return array_key_exists($stepId, $this->getMap());
73 }
74}
if(!\Bitrix\Main\Loader::includeModule('clouds')) $lastId
Определения sync.php:68