Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
workflowstate.php
1<?php
2
4
9
26class WorkflowStateTable extends Entity\DataManager
27{
31 public static function getTableName()
32 {
33 return 'b_bp_workflow_state';
34 }
35
39 public static function getObjectClass()
40 {
41 return WorkflowState::class;
42 }
43
47 public static function getMap()
48 {
49 return [
50 'ID' => [
51 'data_type' => 'string',
52 'primary' => true,
53 ],
54 'MODULE_ID' => [
55 'data_type' => 'string',
56 ],
57 'ENTITY' => [
58 'data_type' => 'string',
59 ],
60 'DOCUMENT_ID' => [
61 'data_type' => 'string',
62 ],
63 'DOCUMENT_ID_INT' => [
64 'data_type' => 'integer',
65 ],
66 'WORKFLOW_TEMPLATE_ID' => [
67 'data_type' => 'integer',
68 ],
69 'STATE' => [
70 'data_type' => 'string',
71 ],
72 'STATE_TITLE' => [
73 'data_type' => 'string',
74 ],
75 'STATE_PARAMETERS' => [
76 'data_type' => 'string',
77 ],
78 'MODIFIED' => [
79 'data_type' => 'datetime',
80 ],
81 'STARTED' => [
82 'data_type' => 'datetime',
83 ],
84 'STARTED_BY' => [
85 'data_type' => 'integer',
86 ],
87 'STARTED_USER' => [
88 'data_type' => '\Bitrix\Main\UserTable',
89 'reference' => [
90 '=this.STARTED_BY' => 'ref.ID',
91 ],
92 'join_type' => 'LEFT',
93 ],
94 'INSTANCE' => [
95 'data_type' => '\Bitrix\Bizproc\Workflow\Entity\WorkflowInstanceTable',
96 'reference' => [
97 '=this.ID' => 'ref.ID',
98 ],
99 'join_type' => 'LEFT',
100 ],
101 'TEMPLATE' => [
102 'data_type' => '\Bitrix\Bizproc\WorkflowTemplateTable',
103 'reference' => [
104 '=this.WORKFLOW_TEMPLATE_ID' => 'ref.ID',
105 ],
106 'join_type' => 'LEFT',
107 ],
109 'TASKS',
110 TaskTable::class,
111 'WORKFLOW_STATE'
112 ),
113 ];
114 }
115
116 public static function getIdsByDocument(array $documentId)
117 {
118 $documentId = \CBPHelper::ParseDocumentId($documentId);
119 $rows = static::getList([
120 'select' => ['ID'],
121 'filter' => [
122 '=MODULE_ID' => $documentId[0],
123 '=ENTITY' => $documentId[1],
124 '=DOCUMENT_ID' => $documentId[2]
125 ]
126 ])->fetchAll();
127
128 return array_column($rows, 'ID');
129 }
130
136 public static function add(array $data)
137 {
138 throw new Main\NotImplementedException("Use CBPStateService class.");
139 }
140
147 public static function update($primary, array $data)
148 {
149 throw new Main\NotImplementedException("Use CBPStateService class.");
150 }
151
157 public static function delete($primary)
158 {
159 throw new Main\NotImplementedException("Use CBPStateService class.");
160 }
161}