1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
LightweightBuilder.php
См. документацию.
1<?php
2
3namespace Bitrix\Socialnetwork\Space\List\Query;
4
5use Bitrix\Main\ORM\Fields\Relations\Reference;
6use Bitrix\Main\ORM\Query\Join;
7use Bitrix\Main\ORM\Query\Query;
8use Bitrix\Socialnetwork\Space\List\Dictionary;
9use Bitrix\Socialnetwork\UserToGroupTable;
10use Bitrix\Socialnetwork\WorkgroupTable;
11
13{
14 protected const SELECT = [
15 'ID',
16 'MEMEBER.USER_ID', // Here and below is Postgres support
17 'MEMBER.ROLE',
18 ];
19
20 public function addModeFilter(string $mode): self
21 {
22 if ($mode === Dictionary::FILTER_MODES['my'])
23 {
24 $this->addFilter(new Filter\Mode\MyModeUnorderedFilter($this->userId));
25 }
26
27 return $this;
28 }
29
30 protected function getBaseQuery(): Query
31 {
32 $groupJoin =
33 Join::on('this.ID', 'ref.GROUP_ID')
34 ->where('ref.USER_ID', $this->userId)
35 ;
36
37 $query = WorkgroupTable::query();
38 $query
39 ->setSelect([
40 'ID',
41 'MEMBER.USER_ID', // Here and below is Postgres support
42 'MEMBER.ROLE',
43 ])
44 ->registerRuntimeField(
45 (new Reference(
46 'MEMBER',
47 UserToGroupTable::class,
48 $groupJoin,
49 ))
50 ->configureJoinType(Join::TYPE_LEFT)
51 )
52 ;
53
54 return $query;
55 }
56}
addFilter(FilterInterface $filter)
Определения AbstractBuilder.php:18
$query
Определения get_search.php:11
Определения chain.php:3