1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
workgrouprequestsin.php
См. документацию.
1
<?php
2
9
10
namespace
Bitrix\Socialnetwork\Internals\Counter\Provider;
11
12
use Bitrix\Main\ArgumentException;
13
use Bitrix\Socialnetwork\UserToGroupTable;
14
15
class
WorkgroupRequestsIn
implements
Base
16
{
17
private
int
$groupId;
18
private
int
$counterValue;
19
20
private
static
array
$instance = [];
21
22
public
static
function
getInstance
($groupId): self
23
{
24
if
(!array_key_exists($groupId, self::$instance))
25
{
26
self::$instance[$groupId] =
new
self
($groupId);
27
}
28
29
return
self::$instance[$groupId];
30
}
31
32
private
function
__construct(
int
$groupId)
33
{
34
if
($groupId <= 0)
35
{
36
throw
new
ArgumentException
(
'Wrong workgroupId value'
);
37
}
38
39
$this->groupId = $groupId;
40
$this->fillCounterValue();
41
}
42
43
public
function
getCounterValue
():
array
44
{
45
return
[
46
'all'
=> $this->counterValue,
47
];
48
}
49
50
private
function
fillCounterValue(): void
51
{
52
$this->counterValue = (new \Bitrix\Main\Entity\Query(UserToGroupTable::getEntity()))
53
->addFilter(
'=GROUP_ID'
, $this->groupId)
54
->addFilter(
'=ROLE'
,
UserToGroupTable::ROLE_REQUEST
)
55
->addFilter(
'=INITIATED_BY_TYPE'
,
UserToGroupTable::INITIATED_BY_USER
)
56
->addSelect(
'ID'
)
57
->countTotal(
true
)
58
->exec()
59
->getCount();
60
}
61
}
Bitrix\Main\ArgumentException
Определения
ArgumentException.php:9
Bitrix\Socialnetwork\Internals\Counter\Provider\WorkgroupRequestsIn
Определения
workgrouprequestsin.php:16
Bitrix\Socialnetwork\Internals\Counter\Provider\WorkgroupRequestsIn\getInstance
static getInstance($groupId)
Определения
workgrouprequestsin.php:22
Bitrix\Socialnetwork\Internals\Counter\Provider\WorkgroupRequestsIn\getCounterValue
getCounterValue()
Определения
workgrouprequestsin.php:43
Bitrix\Socialnetwork\UserToGroupTable\ROLE_REQUEST
const ROLE_REQUEST
Определения
usertogroup.php:54
Bitrix\Socialnetwork\UserToGroupTable\INITIATED_BY_USER
const INITIATED_BY_USER
Определения
usertogroup.php:57
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
Bitrix\Socialnetwork\Internals\Counter\Provider\Base
Определения
base.php:13
bitrix
modules
socialnetwork
lib
internals
counter
provider
workgrouprequestsin.php
Создано системой
1.14.0