Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
workgrouprequestsout.php
1
<?php
2
10
namespace
Bitrix\Socialnetwork\Internals\Counter\Provider
;
11
12
use
Bitrix\Main\ArgumentException
;
13
use
Bitrix\Socialnetwork\UserToGroupTable
;
14
15
class
WorkgroupRequestsOut
implements
Base
16
{
17
private
$workgroupId;
18
19
public
function
__construct
(array $params = [])
20
{
21
$this->workgroupId = (int)($params[
'workgroupId'
] ?? 0);
22
23
if
($this->workgroupId <= 0)
24
{
25
throw
new
ArgumentException
(
'Wrong workgroupId value'
);
26
}
27
}
28
29
public
function
getCounterValue
(): array
30
{
31
$result = (new \Bitrix\Main\Entity\Query(UserToGroupTable::getEntity()))
32
->addFilter(
'=GROUP_ID'
, $this->workgroupId)
33
->addFilter(
'=ROLE'
,
UserToGroupTable::ROLE_REQUEST
)
34
->addFilter(
'=INITIATED_BY_TYPE'
,
UserToGroupTable::INITIATED_BY_GROUP
)
35
->addSelect(
'ID'
)
36
->countTotal(
true
)
37
->exec()
38
->getCount();
39
40
return
[
41
'all'
=> $result,
42
];
43
}
44
}
Bitrix\Main\ArgumentException
Definition
exception.php:34
Bitrix\Socialnetwork\Internals\Counter\Provider\WorkgroupRequestsOut
Definition
workgrouprequestsout.php:16
Bitrix\Socialnetwork\Internals\Counter\Provider\WorkgroupRequestsOut\__construct
__construct(array $params=[])
Definition
workgrouprequestsout.php:19
Bitrix\Socialnetwork\Internals\Counter\Provider\WorkgroupRequestsOut\getCounterValue
getCounterValue()
Definition
workgrouprequestsout.php:29
Bitrix\Socialnetwork\UserToGroupTable
Definition
usertogroup.php:33
Bitrix\Socialnetwork\UserToGroupTable\ROLE_REQUEST
const ROLE_REQUEST
Definition
usertogroup.php:38
Bitrix\Socialnetwork\UserToGroupTable\INITIATED_BY_GROUP
const INITIATED_BY_GROUP
Definition
usertogroup.php:41
Bitrix\Socialnetwork\Internals\Counter\Provider\Base
Definition
base.php:13
Bitrix\Socialnetwork\Internals\Counter\Provider
Definition
base.php:10
modules
socialnetwork
lib
internals
counter
provider
workgrouprequestsout.php
Создано системой
1.10.0