1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
User.php
См. документацию.
1<?php
2
3namespace Bitrix\Im\V2\Controller\Chat;
4
5use Bitrix\Im\V2\Controller\BaseController;
6use Bitrix\Im\V2\RelationCollection;
7
8class User extends BaseController
9{
13 public function listAction(\Bitrix\Im\V2\Chat $chat, array $order = [], int $limit = self::DEFAULT_LIMIT): ?array
14 {
15 $relationOrder = $this->prepareRelationOrder($order);
16 $limit = $this->getLimit($limit);
17 $relationFilter = ['ACTIVE' => true, 'CHAT_ID' => $chat->getId()];
18 $relations = RelationCollection::find($relationFilter, $relationOrder, $limit);
19
20 return $this->toRestFormat($relations->getUsers());
21 }
22
23 private function prepareRelationOrder(array $order): array
24 {
25 if (isset($order['id']))
26 {
27 return ['ID' => strtoupper($order['id'])];
28 }
29 if (isset($order['lastSendMessageId']))
30 {
31 return ['LAST_SEND_MESSAGE_ID' => strtoupper($order['lastSendMessageId'])];
32 }
33 if (isset($order['userId']))
34 {
35 return ['USER_ID' => strtoupper($order['userId'])];
36 }
37
38 return [];
39 }
40}
toRestFormat(RestConvertible ... $entities)
Определения BaseController.php:108
listAction(\Bitrix\Im\V2\Chat $chat, array $order=[], int $limit=self::DEFAULT_LIMIT)
Определения User.php:13
static find(array $filter, array $order=[], ?int $limit=null, ?Context $context=null, array $select=self::COMMON_FIELDS)
Определения RelationCollection.php:50
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
Определения ActionUuid.php:3
$order
Определения payment.php:8