Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
helper.php
1<?php
3
5
6class Helper
7{
8 private $documentType;
9
10 public function __construct($documentType)
11 {
12 $this->documentType = $documentType;
13 }
14
15 public function getWorkflowTemplateIds()
16 {
17 $templateIds = [];
18 $queryResult = \CBPWorkflowTemplateLoader::getList(
19 [], ["DOCUMENT_TYPE" => $this->documentType], false, false, ["ID"]);
20 while ($template = $queryResult->fetch())
21 {
22 $templateIds[] = $template["ID"];
23 }
24 return $templateIds;
25 }
26
27 public function getTriggerIds()
28 {
29 $triggerIds = [];
30
31 $queryResult = TriggerTable::getList([
32 "select" => ["ID"],
33 "filter" => [
34 "=MODULE_ID" => $this->documentType[0],
35 "=ENTITY" => $this->documentType[1],
36 "=DOCUMENT_TYPE" => $this->documentType[2]
37 ]
38 ]);
39 while ($trigger = $queryResult->fetch())
40 {
41 $triggerIds[] = $trigger["ID"];
42 }
43
44 return $triggerIds;
45 }
46}