Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
locker.php
1
<?php
2
3
namespace
Bitrix\Sender\Posting
;
4
5
use
Bitrix\Main\Application
;
6
use
Bitrix\Main\Config\Option
;
7
use
Bitrix\Main\DB
;
8
9
class
Locker
10
{
19
public
static
function
lock
(
string
$key,
int
$id)
20
{
21
$lockName = self::getLockName($key, $id);
22
23
return
Application::getInstance
()->getConnection()->lock($lockName);
24
}
25
34
public
static
function
unlock
(
string
$key,
int
$id)
35
{
36
$lockName = self::getLockName($key, $id);
37
38
return
Application::getInstance
()->getConnection()->unlock($lockName);
39
}
40
49
private
static
function
getLockName(
string
$key,
int
$id): string
50
{
51
return
"{$key}_{$id}"
;
52
}
53
}
Bitrix\Main\Application
Definition
application.php:28
Bitrix\Main\Application\getInstance
static getInstance()
Definition
application.php:95
Bitrix\Main\Config\Option
Definition
option.php:15
Bitrix\Sender\Posting\Locker
Definition
locker.php:10
Bitrix\Sender\Posting\Locker\lock
static lock(string $key, int $id)
Definition
locker.php:19
Bitrix\Sender\Posting\Locker\unlock
static unlock(string $key, int $id)
Definition
locker.php:34
Bitrix\Main\DB
Definition
arrayresult.php:2
Bitrix\Sender\Posting
Definition
builder.php:8
modules
sender
lib
posting
locker.php
Создано системой
1.10.0