Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
counter.php
1
<?php
2
3
namespace
Bitrix\Socialnetwork\Internals
;
4
5
use
Bitrix\Main
;
6
use
Bitrix\Socialnetwork\Internals\Counter\CounterController
;
7
13
class
Counter
14
{
15
private
static
$instance = [];
16
17
private
$userId;
18
23
public
static
function
isReady
($userId): bool
24
{
25
return
array_key_exists($userId, self::$instance);
26
}
27
36
public
static
function
getInstance
($userId): self
37
{
38
if
(!array_key_exists($userId, self::$instance))
39
{
40
self::$instance[$userId] =
new
self
($userId);
41
}
42
43
return
self::$instance[$userId];
44
}
45
56
private
function
__construct($userId)
57
{
58
$this->userId = (int)$userId;
59
}
60
68
public
function
get
($name,
int
$entityId = 0)
69
{
70
return
CounterController::getValue
($name, $entityId, $this->userId);
71
}
72
}
Bitrix\Socialnetwork\Internals\Counter\CounterController
Definition
countercontroller.php:15
Bitrix\Socialnetwork\Internals\Counter\CounterController\getValue
static getValue(string $name='', int $entityId=0, int $userId=0)
Definition
countercontroller.php:16
Bitrix\Socialnetwork\Internals\Counter
Definition
counter.php:14
Bitrix\Socialnetwork\Internals\Counter\getInstance
static getInstance($userId)
Definition
counter.php:36
Bitrix\Socialnetwork\Internals\Counter\isReady
static isReady($userId)
Definition
counter.php:23
Bitrix\Main
Bitrix\Socialnetwork\Internals
Definition
counter.php:3
modules
socialnetwork
lib
internals
counter.php
Создано системой
1.10.0