1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
CollabQuery.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
5namespace Bitrix\Socialnetwork\Collab\Provider;
6
7use Bitrix\Main\ORM\Query\Filter\Condition;
8use Bitrix\Main\ORM\Query\Filter\ConditionTree;
9use Bitrix\Main\ORM\Query\Query;
10use Bitrix\Socialnetwork\Item\Workgroup\Type;
11
13{
14 protected ?ConditionTree $where = null;
15 protected array $select = ['ID'];
16 protected array $groupBy = [];
17 protected array $order = [];
18 protected int $offset = 0;
19 protected int $limit = 0;
20 protected bool $distinct = false;
21
22 protected bool $checkAccess = false;
23
24 protected int $userId;
25
26 final public function __construct(int $userId = 0)
27 {
28 $this->userId = $userId;
29
30 $this->init();
31 }
32
33 public function getUserId(): int
34 {
35 return $this->userId;
36 }
37
38 public function getGroup(): array
39 {
40 return $this->groupBy;
41 }
42
44 {
45 $this->groupBy = $groupBy;
46
47 return $this;
48 }
49
50 public function getOffset(): int
51 {
52 return $this->offset;
53 }
54
55 public function setOffset(int $offset): CollabQuery
56 {
57 $this->offset = $offset;
58
59 return $this;
60 }
61
62 public function getLimit(): int
63 {
64 return $this->limit;
65 }
66
67 public function setLimit(int $limit): CollabQuery
68 {
69 $this->limit = $limit;
70
71 return $this;
72 }
73
74 public function getWhere(): ?ConditionTree
75 {
76 return $this->where;
77 }
78
79 public function setWhere(ConditionTree $where): static
80 {
81 $this->where->where($where);
82
83 return $this;
84 }
85
86 public function addWhere(Condition $condition): static
87 {
88 $this->where->addCondition($condition);
89
90 return $this;
91 }
92
93 public function getSelect(): array
94 {
95 return $this->select;
96 }
97
98 public function setSelect(array $select): static
99 {
100 $this->select = $select;
101
102 if (empty($this->select))
103 {
104 $this->applyIdSelect();
105 }
106
107 return $this;
108 }
109
110 public function getDistinct(): bool
111 {
112 return $this->distinct;
113 }
114
115 public function setDistinct(bool $distinct = true): static
116 {
117 $this->distinct = $distinct;
118
119 return $this;
120 }
121
122 public function getOrder(): array
123 {
124 return $this->order;
125 }
126
127 public function setOrder(array $order): static
128 {
129 $this->order = $order;
130
131 return $this;
132 }
133
134 public function isOnlyId(): bool
135 {
136 return count($this->select) === 1 && in_array('ID', $this->select, true);
137 }
138
139 public function getAccessCheck(): bool
140 {
141 return $this->checkAccess;
142 }
143
144 public function setAccessCheck(bool $check = true): static
145 {
146 $this->checkAccess = $check;
147
148 return $this;
149 }
150
151 protected function applyIdSelect(): void
152 {
153 $this->select[] = 'ID';
154 }
155
156 final protected function init(): void
157 {
158 $this->where = Query::filter();
159 $this->where->where('TYPE', Type::Collab->value);
160 }
161}
return select
Определения access_edit.php:440
setAccessCheck(bool $check=true)
Определения CollabQuery.php:144
setDistinct(bool $distinct=true)
Определения CollabQuery.php:115
setWhere(ConditionTree $where)
Определения CollabQuery.php:79
addWhere(Condition $condition)
Определения CollabQuery.php:86
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936