1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
QueueItem.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Im\V2\Integration\HumanResources\Sync\Item;
4
5
use Bitrix\Im\Model\HrSyncQueueTable;
6
use Bitrix\Main\Type\DateTime;
7
8
class
QueueItem
9
{
10
public
function
__construct
(
11
public
readonly
int
$id,
12
public
readonly
SyncInfo
$syncInfo,
13
public
readonly
int
$pointer,
14
public
readonly
bool
$isLocked,
15
public
readonly
Status
$status
,
16
) {}
17
18
public
static
function
createFromRow
(
array
$row): self
19
{
20
return
new
static
(
21
(int)$row[
'ID'
],
22
SyncInfo::createFromRow
($row),
23
(int)$row[
'POINTER'
],
24
$row[
'IS_LOCKED'
] ===
'Y'
,
25
Status::tryFrom($row[
'STATUS'
]) ?? Status::DEFAULT,
26
);
27
}
28
29
public
function
lock
(): self
30
{
31
HrSyncQueueTable::update
($this->
id
, [
'IS_LOCKED'
=>
true
,
'DATE_UPDATE'
=>
new
DateTime
()]);
32
33
return
$this->
copy
(isLocked:
true
);
34
}
35
36
public
function
unlock
(): self
37
{
38
HrSyncQueueTable::update
($this->
id
, [
'IS_LOCKED'
=>
false
,
'DATE_UPDATE'
=>
new
DateTime
()]);
39
40
return
$this->
copy
(isLocked:
false
);
41
}
42
43
public
function
setErrorStatus
(): self
44
{
45
HrSyncQueueTable::update
($this->
id
, [
'STATUS'
=>
Status::ERROR
->value,
'DATE_UPDATE'
=>
new
DateTime
()]);
46
47
return
$this->
copy
(status:
Status::ERROR
);
48
}
49
50
public
function
updatePointer
(
int
$pointer): self
51
{
52
HrSyncQueueTable::update
($this->
id
, [
'POINTER'
=> $pointer,
'STATUS'
=> Status::DEFAULT->value,
'DATE_UPDATE'
=>
new
DateTime
()]);
53
54
return
$this->
copy
(pointer: $pointer, status: Status::DEFAULT);
55
}
56
57
protected
function
copy
(
58
?
int
$id =
null
,
59
?
SyncInfo
$syncInfo =
null
,
60
?
int
$pointer =
null
,
61
?
bool
$isLocked =
null
,
62
?
Status
$status
=
null
63
): self
64
{
65
return
new
static
(
66
$id ?? $this->id,
67
$syncInfo ?? $this->syncInfo,
68
$pointer ?? $this->pointer,
69
$isLocked ?? $this->isLocked,
70
$status
??
$this->status
,
71
);
72
}
73
}
Bitrix\Im\V2\Integration\HumanResources\Sync\Item\QueueItem
Определения
QueueItem.php:9
Bitrix\Im\V2\Integration\HumanResources\Sync\Item\QueueItem\lock
lock()
Определения
QueueItem.php:29
Bitrix\Im\V2\Integration\HumanResources\Sync\Item\QueueItem\createFromRow
static createFromRow(array $row)
Определения
QueueItem.php:18
Bitrix\Im\V2\Integration\HumanResources\Sync\Item\QueueItem\updatePointer
updatePointer(int $pointer)
Определения
QueueItem.php:50
Bitrix\Im\V2\Integration\HumanResources\Sync\Item\QueueItem\__construct
__construct(public readonly int $id, public readonly SyncInfo $syncInfo, public readonly int $pointer, public readonly bool $isLocked, public readonly Status $status,)
Определения
QueueItem.php:10
Bitrix\Im\V2\Integration\HumanResources\Sync\Item\QueueItem\setErrorStatus
setErrorStatus()
Определения
QueueItem.php:43
Bitrix\Im\V2\Integration\HumanResources\Sync\Item\QueueItem\copy
copy(?int $id=null, ?SyncInfo $syncInfo=null, ?int $pointer=null, ?bool $isLocked=null, ?Status $status=null)
Определения
QueueItem.php:57
Bitrix\Im\V2\Integration\HumanResources\Sync\Item\QueueItem\unlock
unlock()
Определения
QueueItem.php:36
Bitrix\Im\V2\Integration\HumanResources\Sync\Item\SyncInfo
Определения
SyncInfo.php:9
Bitrix\Im\V2\Integration\HumanResources\Sync\Item\SyncInfo\createFromRow
static createFromRow(array $row)
Определения
SyncInfo.php:18
Bitrix\Main\ORM\Data\DataManager\update
static update($primary, array $data)
Определения
datamanager.php:1256
Bitrix\Main\Type\DateTime
Определения
datetime.php:9
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$status
$status
Определения
session.php:10
Bitrix\Im\V2\Integration\HumanResources\Sync\Item\Status
Status
Определения
Status.php:6
Bitrix\Im\V2\Integration\HumanResources\Sync\Item\ERROR
@ ERROR
Определения
Status.php:9
bitrix
modules
im
lib
V2
Integration
HumanResources
Sync
Item
QueueItem.php
Создано системой
1.14.0