Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
AbstractModeFilter.php
1<?php
2
4
9
10abstract class AbstractModeFilter implements FilterInterface
11{
12 public function __construct(protected int $userId)
13 {}
14 abstract public function apply(Query $query): void;
16 {
17 return
18 Query::filter()
19 ->whereNotNull('PIN.ID')
20 ->where($this->getAllVisibleCondition())
21 ;
22 }
23
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
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}