Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
deletestepper.php
1
<?php
2
3
namespace
Bitrix\Bizproc\Worker\Document
;
4
5
use
Bitrix\Main
;
6
7
class
DeleteStepper
extends
Main\Update\Stepper
8
{
9
protected
static
$moduleId
=
'bizproc'
;
10
private
static
$delay = 0;
11
12
private
const
STEP_ROWS_LIMIT = 10;
13
14
public
function
execute
(array &$option)
15
{
16
$documentId = $this->
getOuterParams
();
17
$ids = \CBPStateService::getIdsByDocument($documentId, self::STEP_ROWS_LIMIT);
18
19
if
(empty($ids))
20
{
21
\CBPHistoryService::DeleteByDocument($documentId);
22
return
self::FINISH_EXECUTION
;
23
}
24
25
foreach
($ids as $id)
26
{
27
\CBPDocument::killWorkflow($id,
false
);
28
}
29
30
return
self::CONTINUE_EXECUTION
;
31
}
32
33
public
static
function
bindDocument
(array $documentId): void
34
{
35
$ids = \CBPStateService::getIdsByDocument($documentId, 1);
36
if
(empty($ids))
37
{
38
return
;
39
}
40
41
self::$delay += 60;
42
static::bind(self::$delay, $documentId);
43
}
44
}
Bitrix\Bizproc\Worker\Document\DeleteStepper
Definition
deletestepper.php:8
Bitrix\Bizproc\Worker\Document\DeleteStepper\bindDocument
static bindDocument(array $documentId)
Definition
deletestepper.php:33
Bitrix\Bizproc\Worker\Document\DeleteStepper\execute
execute(array &$option)
Definition
deletestepper.php:14
Bitrix\Bizproc\Worker\Document\DeleteStepper\$moduleId
static $moduleId
Definition
deletestepper.php:9
Bitrix\Main\Update\Stepper
Definition
stepper.php:27
Bitrix\Main\Update\Stepper\getOuterParams
getOuterParams()
Definition
stepper.php:228
Bitrix\Main\Update\Stepper\FINISH_EXECUTION
const FINISH_EXECUTION
Definition
stepper.php:34
Bitrix\Main\Update\Stepper\CONTINUE_EXECUTION
const CONTINUE_EXECUTION
Definition
stepper.php:33
Bitrix\Bizproc\Worker\Document
Definition
deletestepper.php:3
Bitrix\Main
modules
bizproc
lib
worker
document
deletestepper.php
Создано системой
1.10.0