Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
AbstractModeFilter.php
1
<?php
2
3
namespace
Bitrix\Socialnetwork\Space\List\Query\Filter\Mode
;
4
5
use
Bitrix\Main\ORM\Query\Filter\ConditionTree
;
6
use
Bitrix\Main\ORM\Query\Query
;
7
use
Bitrix\Socialnetwork\Space\List\Query\Filter\FilterInterface
;
8
use
Bitrix\Socialnetwork\UserToGroupTable
;
9
10
abstract
class
AbstractModeFilter
implements
FilterInterface
11
{
12
public
function
__construct
(
protected
int
$userId)
13
{}
14
abstract
public
function
apply
(
Query
$query): void;
15
protected
function
getAllPinnedCondition
():
ConditionTree
16
{
17
return
18
Query::filter()
19
->
whereNotNull
(
'PIN.ID'
)
20
->where($this->
getAllVisibleCondition
())
21
;
22
}
23
24
protected
function
getAllVisibleCondition
():
ConditionTree
25
{
26
return
27
Query::filter()
28
->
logic
(ConditionTree::LOGIC_OR)
29
->where($this->
getParticipantCondition
())
30
->where($this->
getRequestCondition
())
31
->where(
'VISIBLE'
,
'Y'
)
32
;
33
}
34
35
protected
function
getParticipantCondition
():
ConditionTree
36
{
37
return
38
Query::filter()
39
->
where
(
'MEMBER.USER_ID'
, $this->userId)
40
->where(
'MEMBER.ROLE'
,
'<='
,
UserToGroupTable::ROLE_USER
)
41
;
42
}
43
44
protected
function
getRequestCondition
():
ConditionTree
45
{
46
return
47
Query::filter()
48
->
where
(
'MEMBER.USER_ID'
, $this->userId)
49
->where(
'MEMBER.ROLE'
,
UserToGroupTable::ROLE_REQUEST
)
50
;
51
}
52
}
Bitrix\Main\ORM\Query\Filter\ConditionTree
Definition
conditiontree.php:28
Bitrix\Main\ORM\Query\Filter\ConditionTree\logic
logic($logic=null)
Definition
conditiontree.php:70
Bitrix\Main\ORM\Query\Filter\ConditionTree\whereNotNull
whereNotNull($column)
Definition
conditiontree.php:261
Bitrix\Main\ORM\Query\Filter\ConditionTree\where
where(... $filter)
Definition
conditiontree.php:125
Bitrix\Main\ORM\Query\Query
Definition
query.php:118
Bitrix\Socialnetwork\Space\List\Query\Filter\Mode\AbstractModeFilter
Definition
AbstractModeFilter.php:11
Bitrix\Socialnetwork\Space\List\Query\Filter\Mode\AbstractModeFilter\getAllPinnedCondition
getAllPinnedCondition()
Definition
AbstractModeFilter.php:15
Bitrix\Socialnetwork\Space\List\Query\Filter\Mode\AbstractModeFilter\getRequestCondition
getRequestCondition()
Definition
AbstractModeFilter.php:44
Bitrix\Socialnetwork\Space\List\Query\Filter\Mode\AbstractModeFilter\__construct
__construct(protected int $userId)
Definition
AbstractModeFilter.php:12
Bitrix\Socialnetwork\Space\List\Query\Filter\Mode\AbstractModeFilter\getAllVisibleCondition
getAllVisibleCondition()
Definition
AbstractModeFilter.php:24
Bitrix\Socialnetwork\Space\List\Query\Filter\Mode\AbstractModeFilter\apply
apply(Query $query)
Bitrix\Socialnetwork\Space\List\Query\Filter\Mode\AbstractModeFilter\getParticipantCondition
getParticipantCondition()
Definition
AbstractModeFilter.php:35
Bitrix\Socialnetwork\UserToGroupTable
Definition
usertogroup.php:33
Bitrix\Socialnetwork\UserToGroupTable\ROLE_USER
const ROLE_USER
Definition
usertogroup.php:36
Bitrix\Socialnetwork\UserToGroupTable\ROLE_REQUEST
const ROLE_REQUEST
Definition
usertogroup.php:38
Bitrix\Socialnetwork\Space\List\Query\Filter\FilterInterface
Definition
FilterInterface.php:8
Bitrix\Socialnetwork\Space\List\Query\Filter\Mode
Definition
AbstractModeFilter.php:3
modules
socialnetwork
lib
Space
List
Query
Filter
Mode
AbstractModeFilter.php
Создано системой
1.10.0