9 private array $templateIdMap = [];
10 private array $offTemplateMap = [];
14 if (!$this->
isForcedMode($workflowId) && $this->isOff($workflowId))
19 return parent::canWrite(
$type, $workflowId);
22 private function isOff($workflowId): bool
24 $this->templateIdMap[$workflowId] ??= $this->getTemplateId($workflowId);
32 private function getTemplateId($workflowId): int
36 return \CBPRuntime::getRuntime()->getWorkflow($workflowId,
true)->getTemplateId();
44 private function isTemplateOff(
int $templateId): bool
47 $onTime = (int)Option::get(
'bizproc',
$optionName, 0);
51 $sevenDays = 7 * 86400;
53 return ($onTime + $sevenDays) <= time();