18 private const SELECT = [
26 'ROLE' =>
'MEMBER.ROLE',
28 'ROLE_INIT_BY_TYPE' =>
'MEMBER.INITIATED_BY_TYPE',
34 private array $filters = [];
42 $this->filters[] = $filter;
49 $query = $this->getBaseQuery();
50 foreach ($this->filters as $filler)
52 $filler->apply($query);
62 $this->addFilter(
new Filter\Mode\AllModeFilter($this->userId));
66 $this->addFilter(
new Filter\Mode\MyModeFilter($this->userId));
70 $this->addFilter(
new Filter\Mode\OtherModeFilter($this->userId));
78 return $this->addFilter(
new Filter\Pagination\PaginationFilter($offset, $limit));
83 return $this->addFilter(
new Filter\Id\IdFilter($spaceId));
88 return $this->addFilter(
new Filter\Id\IdListFilter($spaceIds));
93 return $this->addFilter(
new Filter\Search\NameSearchFilter($searchString));
96 private function getBaseQuery():
Query
99 Join::on(
'this.ID',
'ref.GROUP_ID')
100 ->where(
'ref.USER_ID', $this->userId)
103 $query = WorkgroupTable::query();
105 ->setSelect(self::SELECT)
106 ->addOrder(
'DATE_ACTIVITY',
'DESC')
107 ->registerRuntimeField(
110 WorkgroupPinTable::class,
113 ->configureJoinType(Join::TYPE_LEFT)
115 ->registerRuntimeField(
118 UserToGroupTable::class,
121 ->configureJoinType(Join::TYPE_LEFT)